class TerminalAlertCallback implements AlertCallback {

    @Override
    public boolean alert(final Host host, final BackgroundException failure, final StringBuilder transcript) {
        switch(new DefaultFailureDiagnostics().determine(failure)) {
            case cancel:
                return false;
            default:
                final StringAppender appender = new StringAppender();
                appender.append(failure.getMessage());
                appender.append(failure.getDetail());
                console.printf("%n%s%n", appender.toString());
        }
        // Never repeat
        return false;
    }

}