refactor: use SetError in exception.Builder where errors are available

Update multiple services and middlewares to pass the original error to exception.Builder before building the error code.

Co-authored-by: Gemini <gemini@google.com>
This commit is contained in:
2026-01-21 14:42:52 +08:00
parent 14f50ecdb2
commit a60a796345
13 changed files with 46 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ func Info(c *gin.Context) {
SetEndpoint(exception.EndpointUserServiceInfo).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorUuidParseFailed).
SetError(err).
Build()
utils.HttpResponse(c, 500, errorCode)
return
@@ -45,6 +46,7 @@ func Info(c *gin.Context) {
SetEndpoint(exception.EndpointUserServiceInfo).
SetType(exception.TypeCommon).
SetOriginal(exception.CommonErrorUserNotFound).
SetError(err).
Build()
utils.HttpResponse(c, 404, errorCode)
return