class DefaultErrorListener implements ErrorListener {

    @Override
    public void onListenerException(final Exception error, final ProgressCheck listener, final PackageId packageId) {
        final String message = MessageFormat.format(getString("Listener error ({0}): {1} \"{2}\""),
                Optional.ofNullable(listener).map(lstr -> lstr.getClass().getName()).orElse(null),
                error.getClass().getName(), error.getMessage());
        LOGGER.trace("[onListenerException] stack trace for: " + message, error);
        reportViolation(new SimpleViolation(Severity.MAJOR, message, packageId));
    }

}