Comments (2)
Here is the full exception:
Exception in thread "main" clojure.lang.ExceptionInfo: Call to clojure.core/defn did not conform to spec:
In: [2 2] val: [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}] fails spec: :clojure.core.specs/local-name at: [:args :bs :arity-1 :args :varargs :form :sym] predicate: simple-symbol?
In: [2 2 0] val: ({:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}) fails spec: :clojure.core.specs/seq-binding-form at: [:args :bs :arity-1 :args :varargs :form :seq] predicate: (cat :elems (* :clojure.core.specs/binding-form) :rest (? (cat :amp #{(quote &)} :form :clojure.core.specs/binding-form)) :as (? (cat :as #{:as} :sym :clojure.core.specs/local-name))), Extra input
In: [2 2 0] val: {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts} fails spec: :clojure.core.specs/map-binding at: [:args :bs :arity-1 :args :varargs :form :map :mb] predicate: vector?
In: [2 2 0] val: {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts} fails spec: :clojure.core.specs/ns-keys at: [:args :bs :arity-1 :args :varargs :form :map :nsk] predicate: vector?
In: [2 2 0] val: {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts} fails spec: :clojure.core.specs/map-bindings at: [:args :bs :arity-1 :args :varargs :form :map :msb] predicate: vector?
In: [2 2] val: [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}] fails spec: :clojure.core.specs/map-special-binding at: [:args :bs :arity-1 :args :varargs :form :map] predicate: map?
In: [2 0] val: handler fails spec: :clojure.core.specs/arg-list at: [:args :bs :arity-n :bodies :args] predicate: vector?
:clojure.spec/args (wrap-exceptions "Let Prone handle exeptions instead of Ring. This way, instead of a centered\n stack trace, errors will give you a nice interactive page where you can browse\n data, filter the stack trace and generally get a good grip of what is\n happening.\n\n Optionally, supply a opts map to specify namespaces to include,\n a predicate function to exclude certain requests from prone, and a boolean\n value to silence printing of exception stacktraces e.g.:\n\n => (wrap-exceptions handler {:app-namespaces ['your-ns-1 'my.ns.to-show]\n :skip-prone? (fn [req] (not-browser? req)\n :print-stacktraces? false})" [handler & [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}]] (fn [req] (if-let [page (get (clojure.core/deref pages) (:uri req))] (serve-page page 200) (if-let [asset (asset-url->contents (:uri req))] {:body asset, :status 200, :headers {"Cache-Control" "max-age=315360000"}} (binding [debug/*debug-data* (atom [])] (if (and skip-prone? (skip-prone? req)) (handler req) (try (let [result (handler req)] (if (< 0 (count (clojure.core/deref debug/*debug-data*))) (debug-response req (clojure.core/deref debug/*debug-data*)) result)) (catch Exception e (when print-stacktraces? (.printStackTrace e)) (exceptions-response req e app-namespaces)))))))))
#:clojure.spec{:problems ({:path [:args :bs :arity-1 :args :varargs :form :sym], :pred simple-symbol?, :val [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}], :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/local-name], :in [2 2]} {:path [:args :bs :arity-1 :args :varargs :form :seq], :reason "Extra input", :pred (cat :elems (* :clojure.core.specs/binding-form) :rest (? (cat :amp #{(quote &)} :form :clojure.core.specs/binding-form)) :as (? (cat :as #{:as} :sym :clojure.core.specs/local-name))), :val ({:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}), :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/seq-binding-form], :in [2 2 0]} {:path [:args :bs :arity-1 :args :varargs :form :map :mb], :pred vector?, :val {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}, :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/map-binding-form :clojure.core.specs/map-bindings :clojure.core.specs/map-binding], :in [2 2 0]} {:path [:args :bs :arity-1 :args :varargs :form :map :nsk], :pred vector?, :val {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}, :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/map-binding-form :clojure.core.specs/map-bindings :clojure.core.specs/ns-keys], :in [2 2 0]} {:path [:args :bs :arity-1 :args :varargs :form :map :msb], :pred vector?, :val {:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}, :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/map-binding-form :clojure.core.specs/map-bindings], :in [2 2 0]} {:path [:args :bs :arity-1 :args :varargs :form :map], :pred map?, :val [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}], :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list :clojure.core.specs/binding-form :clojure.core.specs/binding-form :clojure.core.specs/map-binding-form :clojure.core.specs/map-special-binding], :in [2 2]} {:path [:args :bs :arity-n :bodies :args], :pred vector?, :val handler, :via [:clojure.core.specs/defn-args :clojure.core.specs/args+body :clojure.core.specs/args+body :clojure.core.specs/args+body :clojure.core.specs/arg-list :clojure.core.specs/arg-list], :in [2 0]}), :args (wrap-exceptions "Let Prone handle exeptions instead of Ring. This way, instead of a centered\n stack trace, errors will give you a nice interactive page where you can browse\n data, filter the stack trace and generally get a good grip of what is\n happening.\n\n Optionally, supply a opts map to specify namespaces to include,\n a predicate function to exclude certain requests from prone, and a boolean\n value to silence printing of exception stacktraces e.g.:\n\n => (wrap-exceptions handler {:app-namespaces ['your-ns-1 'my.ns.to-show]\n :skip-prone? (fn [req] (not-browser? req)\n :print-stacktraces? false})" [handler & [{:keys [app-namespaces skip-prone? print-stacktraces?], :or {:print-stacktraces? true}, :as opts}]] (fn [req] (if-let [page (get (clojure.core/deref pages) (:uri req))] (serve-page page 200) (if-let [asset (asset-url->contents (:uri req))] {:body asset, :status 200, :headers {"Cache-Control" "max-age=315360000"}} (binding [debug/*debug-data* (atom [])] (if (and skip-prone? (skip-prone? req)) (handler req) (try (let [result (handler req)] (if (< 0 (count (clojure.core/deref debug/*debug-data*))) (debug-response req (clojure.core/deref debug/*debug-data*)) result)) (catch Exception e (when print-stacktraces? (.printStackTrace e)) (exceptions-response req e app-namespaces)))))))))}, compiling:(prone/middleware.clj:98:1)
The problem is in this line: https://github.com/magnars/prone/blob/master/src/prone/middleware.clj#L111-L112 specifically that the :or
default has a keyword key and that should be a symbol instead. I will submit a PR.
from prone.
1.1.2
released with this fix.
from prone.
Related Issues (20)
- Question: How setup prone with immutant 2 HOT 2
- Prone isn't working with lein-ring HOT 9
- GPL License makes it incompatible with pretty much every Clojure library HOT 7
- Prone crashes for projects with unquoted forms in project.clj HOT 5
- An javascript error was raised when running demo application. HOT 3
- putting prone under single url prefix HOT 4
- Not able to see code snippets from within .cljc files HOT 1
- Is there a way to make prone work with ring on top of aleph? HOT 1
- Prone throws an IndexOutOfBoundsException handling a org.postgresql.util.PSQLException HOT 12
- Function to pre-process exceptions HOT 2
- error from prone.js HOT 9
- prone 1.1.2's prone.js causes a SyntaxError HOT 2
- Prone does not catch AssertionErrors HOT 7
- NodeJS HOT 5
- Skip certain exception HOT 2
- Unable to resolve symbol: inst? in this context, compiling:(prone/prep.clj:85:5) HOT 3
- Make use of new facilities in Clojure 1.10
- Missing content-type header (assets) HOT 2
- Test failures in 1.10.0+
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prone.