src/main/java/edu/ucla/library/bucketeer/verticles/FinalizeJobVerticle.java
private void failPromise(final Throwable aException, final String aMessageCode, final String aMessage,
            final Promise<Job> aPromise) {
        final Optional<String> errorChannel = Optional.ofNullable(myConfig.getString(Config.SLACK_ERROR_CHANNEL_ID));

        // If we have a Slack channel configured, we can send an error message to it
        if (errorChannel.isPresent()) {
            final String errorMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_110, aException.getMessage());

            sendSlackMessage(errorChannel.get(), errorMessage);
        }

        LOGGER.error(aException, aMessageCode, aMessage);
        aPromise.fail(aException);
    }
/**
     * Log failures and fail the promise.
     *
     * @param aException An exception indicating the type of failure
     * @param aMessageCode A message code for I18N messages
     * @param aMessage Additional details to add to the message
     * @param aPromise A promise for the work being done
     */
Log failures and fail the promise.
@param aException An exception indicating the type of failure
@param aMessageCode A message code for I18N messages
@param aMessage Additional details to add to the message
@param aPromise A promise for the work being done
Log failures and fail the promise . @param aException An exception indicating the type of failure @param aMessageCode A message code for I18N messages @param aMessage Additional details to add to the message @param aPromise A promise for the work being done
private void failPromise(final Throwable aException, final String aMessageCode, final String aMessage,
            final Promise<Job> aPromise) {
        final Optional<String> errorChannel = Optional.ofNullable(myConfig.getString(Config.SLACK_ERROR_CHANNEL_ID));
        if (errorChannel.isPresent()) {
            final String errorMessage = LOGGER.getMessage(MessageCodes.BUCKETEER_110, aException.getMessage());
            sendSlackMessage(errorChannel.get(), errorMessage);
        }
        LOGGER.error(aException, aMessageCode, aMessage);
        aPromise.fail(aException);
    }
private void failPromise ( final Throwable aException , final String aMessageCode , final String aMessage , final Promise < Job > aPromise ) { final Optional < String > errorChannel = Optional . ofNullable ( myConfig . getString ( Config . SLACK_ERROR_CHANNEL_ID ) ) ; if ( errorChannel . isPresent ( ) ) { final String errorMessage = LOGGER . getMessage ( MessageCodes . BUCKETEER_110 , aException . getMessage ( ) ) ; sendSlackMessage ( errorChannel . get ( ) , errorMessage ) ; } LOGGER . error ( aException , aMessageCode , aMessage ) ; aPromise . fail ( aException ) ; }
Log failures and fail the promise.
Log failures and fail the promise .
// If we have a Slack channel configured, we can send an error message to it