Add context for all exceptions
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -18,7 +18,7 @@ func Full(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointUserServiceFull).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorMissingUserId).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 403, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -31,7 +31,7 @@ func Full(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func Full(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorUserNotFound).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 404, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -59,7 +59,7 @@ func Full(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorDatabase).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -73,6 +73,6 @@ func Full(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointUserServiceFull).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 200, errorCode, userFullResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user