AvisoNovate / rook

Smart namespace-driven routing for Pedestal
http://rook.readthedocs.io/en/latest/index.html
Apache License 2.0
75 stars 11 forks source link

Improve feedback when exceptions occur while compiling dispatch table #14

Closed hlship closed 10 years ago

hlship commented 10 years ago

Currently, the exception doesn't provide any sort of useful context:

             clojure.lang.ExceptionInfo: No default argument resolver for symbol auth-db
    data: {:symbol auth-db}
                                                      clojure.core/ex-info                          core.clj: 4403
                            io.aviso.rook.dispatcher/make-default-resolver                    dispatcher.clj:  362
                              io.aviso.rook.dispatcher/arglist-resolver/fn                    dispatcher.clj:  384
                                                       clojure.core/map/fn                          core.clj: 2557
                                                 clojure.lang.LazySeq.sval                      LazySeq.java:   40
                                                  clojure.lang.LazySeq.seq                      LazySeq.java:   49
                                                       clojure.lang.RT.seq                           RT.java:  484
                                                          clojure.core/seq                          core.clj:  133
                                 io.aviso.rook.dispatcher/arglist-resolver                    dispatcher.clj:  386
                            io.aviso.rook.dispatcher/build-dispatch-map/fn                    dispatcher.clj:  460
                                                 clojure.core.protocols/fn                     protocols.clj:   79
                                               clojure.core.protocols/fn/G                     protocols.clj:   13
                                                       clojure.core/reduce                          core.clj: 6289
                               io.aviso.rook.dispatcher/build-dispatch-map                    dispatcher.clj:  448
                      io.aviso.rook.dispatcher/build-map-traversal-handler                    dispatcher.clj:  489
                           io.aviso.rook.dispatcher/compile-dispatch-table                    dispatcher.clj:  537
                                           io.aviso.rook/namespace-handler                          rook.clj:  158
                                                clojure.lang.RestFn.invoke                       RestFn.java:  628
                                                  flashiz.resources/routes                     resources.clj:   19

We need to provide more information, either via io.aviso/tracker, or by additional try blocks to capture more details about what function of what namespace contains the error.