summaryrefslogtreecommitdiff
path: root/internal/api/errorhandling.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/errorhandling.go')
-rw-r--r--internal/api/errorhandling.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/api/errorhandling.go b/internal/api/errorhandling.go
index 346841f3f..f6fec4168 100644
--- a/internal/api/errorhandling.go
+++ b/internal/api/errorhandling.go
@@ -86,6 +86,10 @@ func genericErrorHandler(c *gin.Context, instanceGet func(ctx context.Context, d
// if something goes wrong during the function, it will recover and just try to serve
// an appropriate application/json content-type error.
func ErrorHandler(c *gin.Context, errWithCode gtserror.WithCode, instanceGet func(ctx context.Context, domain string) (*apimodel.Instance, gtserror.WithCode)) {
+ // set the error on the gin context so that it can be logged
+ // in the gin logger middleware (internal/router/logger.go)
+ c.Error(errWithCode) //nolint:errcheck
+
// discover if we're allowed to serve a nice html error page,
// or if we should just use a json. Normally we would want to
// check for a returned error, but if an error occurs here we