adoroszlai commented on a change in pull request #2772:
URL: https://github.com/apache/ozone/pull/2772#discussion_r742174939
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OmUtils.java
##########
@@ -621,23 +622,27 @@ public static String
getOzoneManagerServiceId(OzoneConfiguration conf)
/**
* Unwrap exception to check if it is some kind of access control problem
- * ({@link AccessControlException} or {@link SecretManager.InvalidToken}).
+ * ({@link AccessControlException} or {@link SecretManager.InvalidToken})
+ * or a RpcException.
*/
- public static boolean isAccessControlException(Exception ex) {
+ public static Throwable getUnwrappedException(Exception ex) {
if (ex instanceof ServiceException) {
Throwable t = ex.getCause();
if (t instanceof RemoteException) {
t = ((RemoteException) t).unwrapRemoteException();
}
while (t != null) {
+ if (t instanceof RpcException) {
+ return t;
+ }
if (t instanceof AccessControlException ||
t instanceof SecretManager.InvalidToken) {
- return true;
+ return t;
Review comment:
Nit: can we merge these two identical `if` blocks?
--
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]