From 80174fd605048810d60e99a6117462a829d600ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Sat, 24 Sep 2022 09:02:05 +0200 Subject: [PATCH] Fix 404 handler to use the proper error format --- cmd/microrouterd/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/microrouterd/main.go b/cmd/microrouterd/main.go index 64c33c1..906f462 100644 --- a/cmd/microrouterd/main.go +++ b/cmd/microrouterd/main.go @@ -162,7 +162,7 @@ func main() { r.Use(ginlogrus.Logger(ilogger.Logrus()), gin.Recovery()) r.NoRoute(func(c *gin.Context) { - c.JSON(404, gin.H{"code": http.StatusNotFound, "message": "page not found"}) + c.JSON(http.StatusNotFound, gin.H{"errors": []gin.H{{"id": "NOT_FOUND", "message": "page not found"}}}) }) // Register gin with micro