The error hook lets you intercept the error returned by your handler, the validation hook, the render hook, and any error during each internal process of KCD.
His role is to return a well-formatted error to the client, based on the error provided.
An error hook must have this signature:
type ErrorHook func(w http.ResponseWriter, r *http.Request, err error, logger kcd.LogHook)
Check out the default ErrorHook implementation herearrow-up-right.
Check out the signature of the ErrorHookarrow-up-right.
Last updated 4 years ago