catch (InvocationTargetException e) { /* fall through */ }
catch (IllegalAccessException e) { /* fall through */ }
catch (InstantiationException e) { /* fall through */ }
log.warn("Exception class " + exceptionClass.getSimpleName() + " failed reflection instantiation");
// we know we want an exception but failed to instantiate it. Throw ANE as default
throw new AuthorizeNetException(responseReasonCode.getReasonText());
}
// umbrella processing for DECLINED
if (responseCode == ResponseCode.DECLINED) {
log.info(logOperation + " failed in amount of " + amount + " for " + userId + ": " + responseReasonCode);
throw new PaymentDeclinedException(responseReasonCode.getReasonText());
}
}
// map all other failures (where no DirectResponseMap or RRC may not be in exceptionMap) into ANE
if (!result.isOk()) {
String message = createErrorMessage(result);
log.warn(logOperation + " failed for " + userId + ": " + message);
throw new AuthorizeNetException(message);
}
return result;
}