diff --git a/src/main/java/io/cryostat/net/web/http/api/beta/CredentialTestPostHandler.java b/src/main/java/io/cryostat/net/web/http/api/beta/CredentialTestPostHandler.java index 391c1f5530..5161fc1d82 100644 --- a/src/main/java/io/cryostat/net/web/http/api/beta/CredentialTestPostHandler.java +++ b/src/main/java/io/cryostat/net/web/http/api/beta/CredentialTestPostHandler.java @@ -162,23 +162,13 @@ public IntermediateResponse handle(RequestParameters param return new IntermediateResponse() .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,