Browse Source

WIP

feature/update-txman3
Eduard S 3 years ago
parent
commit
e737aebd28
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      api/handlers.go

+ 2
- 2
api/handlers.go

@ -38,7 +38,7 @@ var (
) )
func retSQLErr(err error, c *gin.Context) { func retSQLErr(err error, c *gin.Context) {
log.Warn("HTTP API SQL request error", "err", err)
log.Warnw("HTTP API SQL request error", "err", err)
if sqlErr, ok := tracerr.Unwrap(err).(*pq.Error); ok { if sqlErr, ok := tracerr.Unwrap(err).(*pq.Error); ok {
// https://www.postgresql.org/docs/current/errcodes-appendix.html // https://www.postgresql.org/docs/current/errcodes-appendix.html
if sqlErr.Code == "23505" { if sqlErr.Code == "23505" {
@ -59,7 +59,7 @@ func retSQLErr(err error, c *gin.Context) {
} }
func retBadReq(err error, c *gin.Context) { func retBadReq(err error, c *gin.Context) {
log.Warn("HTTP API Bad request error", "err", err)
log.Warnw("HTTP API Bad request error", "err", err)
c.JSON(http.StatusBadRequest, errorMsg{ c.JSON(http.StatusBadRequest, errorMsg{
Message: err.Error(), Message: err.Error(),
}) })

Loading…
Cancel
Save