Skip to content
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

Operation hook for errors #560

Open
bajtos opened this issue Apr 8, 2015 · 1 comment
Open

Operation hook for errors #560

bajtos opened this issue Apr 8, 2015 · 1 comment

Comments

@bajtos
Copy link
Member

bajtos commented Apr 8, 2015

Based on the discussion in strongloop/loopback#1226, it may be useful to provide an operation hook triggered when the operation failed. This will allow hooks to clean up any temporary changes made in a "before" hook.

@bajtos
Copy link
Member Author

bajtos commented Apr 8, 2015

@fabien What's your current opinion on this feature? Do you still needed it now that we have afterRemoteError hooks?

What do you find more helpful, a generic "error" hook that is called when any DAO operation fails, or a more targeted hooks like "save failed" & "delete failed"?

The downside of the generic "error" hook is that the context object will have many different formats, (depending on which operation failed), it may be difficult to describe well in the documentation.

/cc @raymondfeng @ritch Do you have any opinion on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants