adoroszlai opened a new pull request, #10072: URL: https://github.com/apache/ozone/pull/10072
## What changes were proposed in this pull request? `S3ErrorTable` defines errors as instances of `OS3Exception`, leading to potential misuse: - Stack traces of these constants reflect class initialization, not the place where the actual error is encountered. Instead, new instance should be created (e.g. via `S3ErrorTable#newError`) for throwing, but it is easy to forget and throw directly. - Instances are constants, but their properties are mutable. This PR changes `S3ErrorTable` to be an `enum`, which cannot be throw directly, must be used to create the `OS3Exception`. Type name would better be `S3ErrorCode` or similar, but is kept as is for now to reduce change. Also remove unused `S3ErrorTable.getInternalError`. https://issues.apache.org/jira/browse/HDDS-15023 ## How was this patch tested? https://github.com/adoroszlai/ozone/actions/runs/24306299207 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
