class DefaultErrorListener implements ErrorListener {

    @Override
    public void onInstallHookError(final Throwable error, final PackageId packageId) {
        final String message = MessageFormat.format(getString("InstallHook error: {0} \"{1}\""),
                Optional.ofNullable(error.getCause()).orElse(error).getClass().getName(), error.getMessage());
        LOGGER.trace("[onInstallHookError] stack trace for: " + message, error);
        reportViolation(new SimpleViolation(Severity.MAJOR, message, packageId));
    }

}