diff pkg/controllers/user.go @ 4071:5867dcf8e93c

Introduced a new ReadableError type for better readable error messages of pgx.PgErrors.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 25 Jul 2019 13:31:51 +0200
parents fe3dd65c0891
children 1b1218bbd414
line wrap: on
line diff
--- a/pkg/controllers/user.go	Thu Jul 25 12:32:10 2019 +0200
+++ b/pkg/controllers/user.go	Thu Jul 25 13:31:51 2019 +0200
@@ -263,7 +263,8 @@
 	}
 
 	if err != nil {
-		err = pgxutils.HandleError(err)
+		m, c := pgxutils.ReadableError{err}.MessageAndCode()
+		err = JSONError{Code: c, Message: m}
 		return
 	}