Add context for all exceptions

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2026-01-21 19:37:20 +08:00
parent 154c929859
commit 986f63c0af
16 changed files with 91 additions and 87 deletions

View File

@@ -20,7 +20,7 @@ func Info(c *gin.Context) {
SetEndpoint(exception.EndpointEventServiceInfo).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorInvalidInput).
Build()
Build(c)
utils.HttpResponse(c, 400, errorCode)
return
}
@@ -35,7 +35,7 @@ func Info(c *gin.Context) {
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorUuidParseFailed).
SetError(err).
Build()
Build(c)
utils.HttpResponse(c, 500, errorCode)
return
}
@@ -49,7 +49,7 @@ func Info(c *gin.Context) {
SetType(exception.TypeSpecific).
SetOriginal(exception.EventInfoNotFound).
SetError(err).
Build()
Build(c)
utils.HttpResponse(c, 404, errorCode)
return
}
@@ -66,6 +66,6 @@ func Info(c *gin.Context) {
SetEndpoint(exception.EndpointEventServiceInfo).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonSuccess).
Build()
Build(c)
utils.HttpResponse(c, 200, errorCode, eventInfoResp)
}