Skip to content

Commit

Permalink
rollback error handling since abstractV2 handler handles them afterwards
Browse files Browse the repository at this point in the history
Signed-off-by: Max Cao <macao@redhat.com>
  • Loading branch information
maxcao13 committed Mar 28, 2023
1 parent 22d70b4 commit 6b4f202
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,13 @@ public IntermediateResponse<CredentialTestResult> handle(RequestParameters param
return new IntermediateResponse<CredentialTestResult>()
.body(CredentialTestResult.FAILURE);
}
throw resolveErrors(e2);
throw e2;
}
}
throw resolveErrors(e1);
throw e1;
}
}

ApiException resolveErrors(Exception e) throws Exception {
if (AbstractAuthenticatedRequestHandler.isJmxSslFailure(e)) {
return new ApiException(502, "Target SSL Untrusted", e);
}
if (AbstractAuthenticatedRequestHandler.isServiceTypeFailure(e)) {
return new ApiException(504, "Non-JMX Port", e);
}
return new ApiException(500, "Internal Error", e);
}

static enum CredentialTestResult {
SUCCESS,
FAILURE,
Expand Down

0 comments on commit 6b4f202

Please sign in to comment.