Don't expose errors

This commit is contained in:
rxdn 2024-11-11 23:34:23 +00:00
parent e39d73f2da
commit 941c033323

View File

@ -27,4 +27,10 @@ func ErrorHandler(c *gin.Context) {
Error: message,
})
}
if c.Writer.Status() >= 500 && len(c.Errors) == 0 {
c.JSON(-1, ErrorResponse{
Error: "An internal server error occurred",
})
}
}