From d03427d29ddd69c1411ec437a004a3e58fc6214f Mon Sep 17 00:00:00 2001 From: Florian Sylvain Date: Tue, 20 Dec 2022 00:05:29 +0100 Subject: [PATCH] Improved validation error message --- internal/articlesHandlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/articlesHandlers.go b/internal/articlesHandlers.go index cc5988b..94f7b8f 100644 --- a/internal/articlesHandlers.go +++ b/internal/articlesHandlers.go @@ -56,7 +56,7 @@ func AddArticleHandler(c *gin.Context) { err = pushDocument(articlesLocation, document) if err != nil { - SendBadRequest(c, "Could not insert document into DB.") + SendBadRequest(c, fmt.Sprintf(`Could not insert document into DB: %v`, err.Error())) return }