add custom message for error response
This commit is contained in:
parent
8f78dd25cf
commit
2de83644b8
@ -2,6 +2,9 @@ package api
|
|||||||
|
|
||||||
import "github.com/gin-gonic/gin"
|
import "github.com/gin-gonic/gin"
|
||||||
|
|
||||||
func errorResponse(err error) gin.H {
|
func errorResponse(err error, msg string) gin.H {
|
||||||
return gin.H{"error": err.Error()}
|
return gin.H{
|
||||||
|
"error": err.Error(),
|
||||||
|
"message": msg,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user