Skip to content

Instantly share code, notes, and snippets.

@samedhi
Created May 9, 2018
Embed
What would you like to do?
// REPL
inferno.firestore> (reflect EventListener)
{:bases nil,
:flags #{:interface :public :abstract},
:members #{#clojure.reflect.Method{:name onEvent, :return-type void, :declaring-class com.google.cloud.firestore.EventListener, :parameter-types [java.lang.Object com.google.cloud.firestore.FirestoreException], :exception-types [], :flags #{:public :abstract}}}}
// CODE
(defn event-listener [c]
(reify EventListener
(onEvent [snapshot e]
(put!
c
(if (some? snapshot)
(-> snapshot (.getData) hashmap->clj)
{:error true :exception e})))))
=>
2. Unhandled clojure.lang.Compiler$CompilerException
Error compiling src/inferno/firestore.clj at (74:3)
Compiler.java: 6925 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6700 clojure.lang.Compiler/analyze
Compiler.java: 6906 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6700 clojure.lang.Compiler/analyze
Compiler.java: 6656 clojure.lang.Compiler/analyze
Compiler.java: 6029 clojure.lang.Compiler$BodyExpr$Parser/parse
Compiler.java: 5406 clojure.lang.Compiler$FnMethod/parse
Compiler.java: 3972 clojure.lang.Compiler$FnExpr/parse
Compiler.java: 6916 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6700 clojure.lang.Compiler/analyze
Compiler.java: 6906 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6700 clojure.lang.Compiler/analyze
Compiler.java: 38 clojure.lang.Compiler/access$300
Compiler.java: 589 clojure.lang.Compiler$DefExpr$Parser/parse
Compiler.java: 6918 clojure.lang.Compiler/analyzeSeq
Compiler.java: 6700 clojure.lang.Compiler/analyze
Compiler.java: 6656 clojure.lang.Compiler/analyze
Compiler.java: 6981 clojure.lang.Compiler/eval
Compiler.java: 7429 clojure.lang.Compiler/load
boot.user2754507741930941962.clj: 1 inferno.firestore/eval6964
boot.user2754507741930941962.clj: 1 inferno.firestore/eval6964
Compiler.java: 6977 clojure.lang.Compiler/eval
Compiler.java: 6940 clojure.lang.Compiler/eval
core.clj: 3187 clojure.core/eval
core.clj: 3183 clojure.core/eval
main.clj: 242 clojure.main/repl/read-eval-print/fn
main.clj: 242 clojure.main/repl/read-eval-print
main.clj: 260 clojure.main/repl/fn
main.clj: 260 clojure.main/repl
main.clj: 176 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 657 clojure.core/apply
core.clj: 1963 clojure.core/with-bindings*
core.clj: 1963 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 85 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 222 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 190 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1149 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 624 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 748 java.lang.Thread/run
1. Caused by java.lang.IllegalArgumentException
Can't define method not in interfaces: onEvent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment