Add context for all exceptions
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -22,7 +22,7 @@ func Refresh(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInvalidInput).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func Refresh(c *gin.Context) {
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRefreshInvalidToken).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 401, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func Refresh(c *gin.Context) {
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRefreshRenewFailed).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -70,6 +70,6 @@ func Refresh(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointAuthServiceRefresh).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonSuccess).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 200, errorCode, tokenResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user