class DefaultErrorListener implements ErrorListener {

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

}