()
| 232 | } |
| 233 | |
| 234 | func ErrorLoggingMiddleware() gin.HandlerFunc { |
| 235 | return gin.CustomRecoveryWithWriter(nil, func(c *gin.Context, err any) { |
| 236 | log.Error().Any("error", err).Str("uri", c.Request.RequestURI).Msg("Internal error") |
| 237 | if !c.IsWebsocket() { |
| 238 | c.JSON(http.StatusInternalServerError, apitypes.Error("Internal server error")) |
| 239 | } |
| 240 | }) |
| 241 | } |
no test coverage detected