diff controllers/json.go @ 241:3b688fe04c39

No omitempty if JSON serialising PostgreSQL errors.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 26 Jul 2018 18:08:58 +0200
parents 9012e4045da4
children dfc2b035e055
line wrap: on
line diff
--- a/controllers/json.go	Thu Jul 26 17:56:02 2018 +0200
+++ b/controllers/json.go	Thu Jul 26 18:08:58 2018 +0200
@@ -7,8 +7,9 @@
 	"log"
 	"net/http"
 
+	"github.com/jackc/pgx"
+
 	"gemma.intevation.de/gemma/auth"
-	"github.com/jackc/pgx"
 )
 
 type JSONResult struct {
@@ -54,8 +55,8 @@
 		case pgx.PgError:
 			var res = struct {
 				Result  string `json:"result"`
-				Code    string `json:"code,omitempty"`
-				Message string `json:"message,omitempty"`
+				Code    string `json:"code"`
+				Message string `json:"message"`
 			}{
 				Result:  "failure",
 				Code:    e.Code,