From 6b4f2025eca684c3a45d1c63c1a9aad0a9aa4028 Mon Sep 17 00:00:00 2001 From: Max Cao Date: Mon, 27 Mar 2023 19:46:13 -0400 Subject: [PATCH] rollback error handling since abstractV2 handler handles them afterwards Signed-off-by: Max Cao --- .../http/api/beta/CredentialTestPostHandler.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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,