Closed tgreiser closed 10 years ago
You can use SetErrorHandler to explicitly handle errors yourself.
FYI - the DefaultErrorHandler is what writes that error page out - see https://github.com/stretchr/goweb/blob/master/handlers/default_error_handler.go#L24
Thank you!
On a controller, if Before() returns an error, where does that error go? If I do this I get an error/debug HTML page that looks like it's generated by goweb (in response to a JSON API request).
func (controller *SecureController) Before(ctx context.Context) error { if controller.Authenticate() == false { return errors.New("Authentication failed") } return nil }
I want to handle this authentication error myself, but I'm not sure how or where I should go about that.
<!DOCTYPE html>
Error in
PATCH|OPTIONS users/{id} - 0x81c9070
Failed authentication
*errors.errorString
error in Handler0x18b78830