bharatviswa504 commented on a change in pull request #2659:
URL: https://github.com/apache/ozone/pull/2659#discussion_r711790848
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
##########
@@ -310,9 +310,11 @@ private static OMClientRequest getOMAclRequest(OMRequest
omRequest) {
* @param exception
* @return OzoneManagerProtocolProtos.Status
*/
- public static Status exceptionToResponseStatus(IOException exception) {
+ public static Status exceptionToResponseStatus(Exception exception) {
if (exception instanceof OMException) {
return Status.values()[((OMException) exception).getResult().ordinal()];
+ } else if (exception instanceof IllegalArgumentException) {
Review comment:
IMHO instead of changing here, the validateAndUpdateCache should not
throw IllegalArgumentException and throw an OMException and set that as
response status using createErrorOMResponse(omResponse, exception)
In general validateAndUpdateCache should not throw any RunTimeExceptions,
and it should handle errors and generate response.
--
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]