unit tests for error handling

This commit is contained in:
Tim Möhlmann 2023-09-22 10:02:11 +03:00
parent 6f45991600
commit 57e8b19a8b
2 changed files with 401 additions and 1 deletions

View file

@ -165,5 +165,5 @@ func WriteError(w http.ResponseWriter, r *http.Request, err error, logger *slog.
e := oidc.DefaultToServerError(statusError.parent, statusError.parent.Error())
logger.Log(r.Context(), e.LogLevel(), "request error", "oidc_error", e)
httphelper.MarshalJSONWithStatus(w, oidc.DefaultToServerError(e, e.Error()), statusError.statusCode)
httphelper.MarshalJSONWithStatus(w, e, statusError.statusCode)
}