mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Wrap all errors with tracerr
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/hermeznetwork/hermez-node/db/historydb"
|
||||
"github.com/hermeznetwork/tracerr"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -32,7 +33,7 @@ var (
|
||||
)
|
||||
|
||||
func retSQLErr(err error, c *gin.Context) {
|
||||
if err == sql.ErrNoRows {
|
||||
if tracerr.Unwrap(err) == sql.ErrNoRows {
|
||||
c.JSON(http.StatusNotFound, errorMsg{
|
||||
Message: err.Error(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user