Skip to content

Commit fa020d0

Browse files
authored
fix: improve error messaging for http hooks (#1821)
## What kind of change does this PR introduce? * HTTP hooks that return status codes outside of the accepted status codes will cause Auth to return an obscure error message that is hard to debug: `Error executing Hook` - this change is an attempt to improve the error messaging to reflect the status code being rejected ## What is the current behavior? Please link any relevant issues here. ## What is the new behavior? Feel free to include screenshots if it includes visual changes. ## Additional context Add any other context or screenshots.
1 parent 3b03472 commit fa020d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/api/hooks.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (a *API) runHTTPHook(r *http.Request, hookConfig conf.ExtensibilityPointCon
179179
case http.StatusUnauthorized:
180180
return nil, internalServerError("Hook requires authorization token")
181181
default:
182-
return nil, internalServerError("Error executing Hook")
182+
return nil, internalServerError("Unexpected status code returned from hook: %d", rsp.StatusCode)
183183
}
184184
}
185185
return nil, nil

0 commit comments

Comments
 (0)