-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrap-stacktrace is awkward to call conditionally #9
Comments
To me that reads as if wrap-stacktrace should apply only in a production setting. Wouldn't the more natural usage be: (trace/wrap-stacktrace (env/env :dev)) or at least: (trace/wrap-stacktrace (not (env/env :production))) |
Good call; the option should probably be stated in the positive rather than the negative. |
Sorry for taking a while to notice this. I'm not getting notifications for the ring-clojure organization anymore. |
I think that this might not be the best idea... The Instead, perhaps just factoring development middleware into a separate function could be a solution: (defn wrap-dev-middleware [handler]
(if (= (env :ring-env) "production")
handler
(-> handler
wrap-stacktrace
wrap-reload
wrap-whatever-else))) |
Yeah, on further consideration this is probably too specific and not the right place for it. |
Typically you only want
wrap-stacktrace
to take effect in a development setting. Doing this with environ looks something like this:If
wrap-stacktrace
took a second argument to turn it into a no-op, it would be easier to use in the context of->
.What do you think?
The text was updated successfully, but these errors were encountered: