Return every error as {"error": "..."}

Echo errors, middleware and handlers used three different formats (message object, error object, bare string). One error handler now writes all of them the same way; status codes are unchanged.
This commit is contained in:
Sansan committed 2026-10-06 16:21:14 +02:00
1 parent bc7d406e41
commit 0ec2425f78
9 files changed
+67 -21

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ func SyncCheck(isSyncing func() bool) echo.MiddlewareFunc {
return func(c *echo.Context) error {
if isSyncing() {
logging.GetLogger().Info("Syncing is in progress - request blocked")
return c.JSON(http.StatusLocked, "Syncing is in progress")
return echo.NewHTTPError(http.StatusLocked, "Syncing is in progress")
}
return next(c)
}