DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=29642>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29642 Error in catching exception and checking instanceof Summary: Error in catching exception and checking instanceof Product: Commons Version: unspecified Platform: PC OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Validator AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] In class Validator method validateFieldForRule you use reflection whitch throw InvocationtargetException and you catch all Exception and check if its instance of ValidatorException since you will get a InvocationTargetException which has the real exception the if is useless. private boolean validateFieldForRule( } catch (Exception e) { log.error("reflection: " + e.getMessage(), e); results.add(field, va.getName(), false); -------->> if (e instanceof ValidatorException) { throw ((ValidatorException) e); } return false; } return true; va.lang.reflect.InvocationTargetException: org.apache.commons.validator.ValidatorException: Erreur lors du transport Exception :Can't connect to the Entitlements Server. at com.lq.clubvip.web.validations.Validation.validerCodeUsagerInutilise (Validation.java:1469) } catch (Exception e) { log.error("reflection: " + e.getMessage(), e); results.add(field, va.getName(), false); -------->> if (((java.lang.reflect.InvocationTargetException) e).getTargetException() instanceof ValidatorException) { throw ((ValidatorException) e); } return false; } return true; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
