The hook system has a big issue where the "pre" function hook signature differs from the "post". This is a bug. They should be the same and the "post" is correct, the "pre" is not.
Both the "pre" and "post" should have the first argument be a possible error object. The second arg should be the "data" object.
The hook system only processes errors for post hooks, not pre hooks. So, by fixing the "pre" function signature, fixing up error handling to prevent the hook from finishing should be easy.
This shouldn't impact plugins or the SDK with these changes since "pre" hooks are used often.
The fire hook callback (the calls from the SDK) current emit 3 args, though only 2 make sense. We should fix this, but this will break 3.2.0. This can be fixed by checking the callback function length.
Lastly, the if a pre or post function hook should fail, then all places in the SDK that fire a hook should look for errors and gracefully abort the operation.