Skip to content

Wrap custom hook RPC errors

James Fargher requested to merge custom_hook_failure_logging into master

Fixes #4716 (closed)

Returns the wrapped custom hook error instead of generating a new error with no context. This allows the actual error cause to be logged. The GRPC error message for custom hook errors are not given to users. These are for debugging only.

This causes a slight duplication in data with the structured GRPC error, but only in the case where the hook has sensible stdout/stderr. In all other cases the extra context is required to determine what went wrong.

Ideally the extra information like the hook path would be added as error metadata rather than encoded in the message itself. Doing so, however, causes too many tests to fail. Instead, the assertions relying on these specific error messages were made less specific to avoid asserting hook paths that have generated paths.

Edited by James Fargher

Merge request reports