feat: add log level for better debugging

This commit is contained in:
Jonas Kaninda
2024-11-10 19:58:53 +01:00
parent 0d406e3256
commit bbaf47fa0c
13 changed files with 96 additions and 42 deletions

View File

@@ -46,7 +46,7 @@ func (intercept InterceptErrors) ErrorInterceptor(next http.Handler) http.Handle
rec := newResponseRecorder(w)
next.ServeHTTP(rec, r)
if canIntercept(rec.statusCode, intercept.Errors) {
logger.Error("Backend error")
logger.Debug("Backend error")
logger.Error("An error occurred from the backend with the status code: %d", rec.statusCode)
w.Header().Set("Content-Type", "application/json")
//Update Origin Cors Headers