class DefaultErrorListener implements ErrorListener {

    @Override
    public void onJcrPrivilegeRegistrationError(final Throwable error, final String jcrPrivilege) {
        if (error.getCause() != null) {
            onJcrPrivilegeRegistrationError(error.getCause(), jcrPrivilege);
        } else {
            final String message = MessageFormat.format(getString("JCR privilege registration error ({0}): {1} \"{2}\""),
                    jcrPrivilege, error.getClass().getName(), error.getMessage());
            LOGGER.trace("[onJcrPrivilegeRegistrationError] stack trace for: " + message, error);
            reportViolation(new SimpleViolation(Severity.MAJOR, message));
        }
    }

}