class DefaultErrorListener implements ErrorListener {

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

}