-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring packages error processing #27979
Conversation
services/packages/packages.go
Outdated
ErrQuotaTypeSize = util.NewInvalidArgumentErrorf("maximum allowed package type size exceeded") | ||
ErrQuotaTotalSize = util.NewInvalidArgumentErrorf("maximum allowed package storage quota exceeded") | ||
ErrQuotaTotalCount = util.NewInvalidArgumentErrorf("maximum allowed package count exceeded") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "you have reached a limit" an "argument error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Added draft with FailedPrecondition
(similar with gRPC spec) error in this branch. Would it be valid for current scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a mistake that only ErrQuotaTotalCount
is a util.NewFailedPreconditionErrorf
?
I added some corrections and simplifactions to enhance the error handling process.
I am not sure about this implementation or whether this approach might be applicable. This model might be useful because different internal error changes will be handled automatically, potentially reducing the number of accidental errors, but it requires additional attention to error messages since those messages might be passed to the client side. |
Unifyed approach to form response codes from gitea errors in packages module.