loopback-datasource-juggler icon indicating copy to clipboard operation
loopback-datasource-juggler copied to clipboard

Operation hook for errors

Open bajtos opened this issue 10 years ago • 1 comments

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.

bajtos avatar Apr 08 '15 06:04 bajtos

@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?

bajtos avatar Apr 08 '15 06:04 bajtos