-
Notifications
You must be signed in to change notification settings - Fork 1
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
LRS-61 Remove Error Interceptor #71
Conversation
(build {:lrs lrs | ||
:wrap-interceptors [i/error-interceptor]})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demonstrates plugging in your own
This reverts commit c342415.
They are still "thrown" in the pedestal sense by addition to the ctx map
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to hold off on approval until this bug is addressed:
Wowww. I’ve confirmed that w/o the error handler cljs also just up and dies, but oddly it also does with the handler, lol. Gonna re-check the handler for cljs compat, just in case
Yeah, that looks like a separate bug in the terminator-injector and not something that started with my branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misunderstood the implications of the above revelation (i.e. the two issues are not connected); otherwise this looks great.
LET MY PEOPLE THROW (Kinda)
Exception handling should be delegated to implementations based on their needs regarding logging, security, etc.
We were applying an error handling interceptor erroneously to all the routes but doc, this has been changed (see below)
We also included errors in the return spec for sync
lrs
methods, but did not catch and ensure these were included for the lib handling to use. Catching and passing of errors has been standardized across all sync method wrappers inlrs.cljc
with the exception ofconsistent-through
, which is called by an interceptor and functions differently.Any error that is not explicitly handled by the
lrs
layer (a narrow class of specific named errors) will now be properly placed in the pedestal context map. Implementations can apply any error handling they wish by providing an error interceptor in the:wrap-interceptors
vector passed toroutes/build
.UPDATE: The default for the
:wrap-interceptors
vector is now[i/error-interceptor]
per @kelvinqian00's request, meaning the default behavior will not change for implementations, though it will now also apply to doc routes which it did not before.:wrap-interceptors
arg to routs build for passing your own global interceptors