Add context for all exceptions
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -21,7 +21,7 @@ func Redirect(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInvalidInput).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -34,7 +34,7 @@ func Redirect(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInvalidInput).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -47,7 +47,7 @@ func Redirect(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInvalidInput).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -63,7 +63,7 @@ func Redirect(c *gin.Context) {
|
||||
SetEndpoint(exception.EndpointAuthServiceRedirect).
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRedirectTokenInvalid).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 403, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -88,7 +88,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInternal).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInternal).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRedirectClientNotFound).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -130,7 +130,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRedirectUriMismatch).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -144,7 +144,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorInternal).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
return
|
||||
}
|
||||
@@ -158,7 +158,7 @@ func Redirect(c *gin.Context) {
|
||||
SetType(exception.TypeSpecific).
|
||||
SetOriginal(exception.AuthRedirectInvalidUri).
|
||||
SetError(err).
|
||||
Build()
|
||||
Build(c)
|
||||
utils.HttpResponse(c, 400, errorCode)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user