loopback-datasource-juggler
loopback-datasource-juggler copied to clipboard
Operation hook for errors
Based on the discussion in https://github.com/strongloop/loopback/issues/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.
@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?