refactor: update exception constants to follow new naming convention
- Update old ErrorStatus, ErrorType, and Service/Endpoint constants to new naming convention - Fix incorrect TypeSpecific usage in JWT middleware - Add missing event specific error definitions to specific.yaml - Regenerate exception constants Co-authored-by: Gemini <gemini@google.com>
This commit is contained in:
@@ -14,10 +14,10 @@ func Info(c *gin.Context) {
|
||||
userIdOrig, ok := c.Get("user_id")
|
||||
if !ok {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.ErrorStatusUser).
|
||||
SetService(exception.UserService).
|
||||
SetEndpoint(exception.UserInfoEndpoint).
|
||||
SetType(exception.ErrorTypeCommon).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorMissingUserId).
|
||||
Build()
|
||||
utils.HttpResponse(c, 403, errorCode)
|
||||
@@ -26,10 +26,10 @@ func Info(c *gin.Context) {
|
||||
userId, err := uuid.Parse(userIdOrig.(string))
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.ErrorStatusServer).
|
||||
SetService(exception.UserService).
|
||||
SetEndpoint(exception.UserInfoEndpoint).
|
||||
SetType(exception.ErrorTypeCommon).
|
||||
SetStatus(exception.StatusServer).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorUuidParseFailed).
|
||||
Build()
|
||||
utils.HttpResponse(c, 500, errorCode)
|
||||
@@ -40,10 +40,10 @@ func Info(c *gin.Context) {
|
||||
user, err := userData.GetByUserId(userId)
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.ErrorStatusUser).
|
||||
SetService(exception.UserService).
|
||||
SetEndpoint(exception.UserInfoEndpoint).
|
||||
SetType(exception.ErrorTypeCommon).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceInfo).
|
||||
SetType(exception.TypeCommon).
|
||||
SetOriginal(exception.CommonErrorUserNotFound).
|
||||
Build()
|
||||
utils.HttpResponse(c, 404, errorCode)
|
||||
|
||||
Reference in New Issue
Block a user