Add the proper exception handling
@@ -70,8 +70,9 @@ public abstract class BaseVerifier implements Verifier {
customize(params);
// the connector must support ping check if its verifiable
- List<VerifierResponse> resp = new ArrayList<VerifierResponse>();
+ List<VerifierResponse> resp = new ArrayList<>();
for (Verifier.Scope scope : Verifier.Scope.values()) {
+ try {
ComponentVerifier.Result result = verifier.verify(toComponentScope(scope), params);
resp.add(toVerifierResponse(result));
log.info("PING: {} === {}",
@@ -86,6 +87,10 @@ public abstract class BaseVerifier implements Verifier {
result.getStatus() == ComponentVerifier.Result.Status.UNSUPPORTED) {
break;
}
+ } catch (Exception exp) {
+ resp.add(toExceptionResponse(exp, scope, params.keySet()));
+ log.error("Exception during verify with params {} and scope {} : {}", params, scope, exp.getMessage(), exp);
+ }
}
return resp;
}
