Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d14b35fb92
6
init.go
6
init.go
@ -43,7 +43,11 @@ func InitServer() *gin.Engine {
|
||||
engine.Use(ginzap.CustomRecoveryWithZap(zap.L(), true, func(c *gin.Context, e interface{}) {
|
||||
switch e := e.(type) {
|
||||
case error:
|
||||
c.JSON(http.StatusInternalServerError, e)
|
||||
c.JSON(http.StatusInternalServerError, &dto.ErrorDto{
|
||||
Code: dto.LogicError,
|
||||
Tip: dto.ErrorTipMap[dto.LogicError],
|
||||
Message: e.Error(),
|
||||
})
|
||||
case dto.ErrorDto:
|
||||
e.Tip = dto.ErrorTipMap[e.Code]
|
||||
c.JSON(http.StatusInternalServerError, e)
|
||||
|
Loading…
Reference in New Issue
Block a user