src/main/java/edu/ucla/library/iiif/auth/handlers/AccessTokenHandler.java
public static void handleFailure(final RoutingContext aContext) {
        final ServiceException error;
        final HttpServerRequest request;
        final HttpServerResponse response;
        final String responseMessage;
        final JsonObject data;
        final AccessCookieServiceError errorCode;

        try {
            error = (ServiceException) aContext.failure();
        } catch (final ClassCastException details) {
            aContext.fail(HTTP.INTERNAL_SERVER_ERROR, details);
            LOGGER.error(MessageCodes.AUTH_010, details);
            return;
        }

        request = aContext.request();
        response = aContext.response();
        data = new JsonObject();
        errorCode = AccessCookieServiceImpl.getError(error);

        switch (errorCode) {
            case INVALID_COOKIE:
                response.setStatusCode(HTTP.BAD_REQUEST);
                responseMessage = LOGGER.getMessage(MessageCodes.AUTH_011);
                break;
            case CONFIGURATION:
            default:
                response.setStatusCode(HTTP.INTERNAL_SERVER_ERROR);
                responseMessage = LOGGER.getMessage(MessageCodes.AUTH_012);
                break;
        }
        data.put(ResponseJsonKeys.ERROR, errorCode).put(ResponseJsonKeys.MESSAGE, responseMessage);
        response.putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()).end(data.encodePrettily());

        LOGGER.error(MessageCodes.AUTH_006, request.method(), request.absoluteURI(), responseMessage);
    }
/**
     * Handle failure events sent by {@link #handle}.
     *
     * @param aContext the failure event to handle
     */
Handle failure events sent by  #handle.
@param aContext the failure event to handle
Handle failure events sent by #handle . @param aContext the failure event to handle
public static void handleFailure(final RoutingContext aContext) {
        final ServiceException error;
        final HttpServerRequest request;
        final HttpServerResponse response;
        final String responseMessage;
        final JsonObject data;
        final AccessCookieServiceError errorCode;
        try {
            error = (ServiceException) aContext.failure();
        } catch (final ClassCastException details) {
            aContext.fail(HTTP.INTERNAL_SERVER_ERROR, details);
            LOGGER.error(MessageCodes.AUTH_010, details);
            return;
        }
        request = aContext.request();
        response = aContext.response();
        data = new JsonObject();
        errorCode = AccessCookieServiceImpl.getError(error);
        switch (errorCode) {
            case INVALID_COOKIE:
                response.setStatusCode(HTTP.BAD_REQUEST);
                responseMessage = LOGGER.getMessage(MessageCodes.AUTH_011);
                break;
            case CONFIGURATION:
            default:
                response.setStatusCode(HTTP.INTERNAL_SERVER_ERROR);
                responseMessage = LOGGER.getMessage(MessageCodes.AUTH_012);
                break;
        }
        data.put(ResponseJsonKeys.ERROR, errorCode).put(ResponseJsonKeys.MESSAGE, responseMessage);
        response.putHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON.toString()).end(data.encodePrettily());
        LOGGER.error(MessageCodes.AUTH_006, request.method(), request.absoluteURI(), responseMessage);
    }
public static void handleFailure ( final RoutingContext aContext ) { final ServiceException error ; final HttpServerRequest request ; final HttpServerResponse response ; final String responseMessage ; final JsonObject data ; final AccessCookieServiceError errorCode ; try { error = ( ServiceException ) aContext . failure ( ) ; } catch ( final ClassCastException details ) { aContext . fail ( HTTP . INTERNAL_SERVER_ERROR , details ) ; LOGGER . error ( MessageCodes . AUTH_010 , details ) ; return ; } request = aContext . request ( ) ; response = aContext . response ( ) ; data = new JsonObject ( ) ; errorCode = AccessCookieServiceImpl . getError ( error ) ; switch ( errorCode ) { case INVALID_COOKIE : response . setStatusCode ( HTTP . BAD_REQUEST ) ; responseMessage = LOGGER . getMessage ( MessageCodes . AUTH_011 ) ; break ; case CONFIGURATION : default : response . setStatusCode ( HTTP . INTERNAL_SERVER_ERROR ) ; responseMessage = LOGGER . getMessage ( MessageCodes . AUTH_012 ) ; break ; } data . put ( ResponseJsonKeys . ERROR , errorCode ) . put ( ResponseJsonKeys . MESSAGE , responseMessage ) ; response . putHeader ( HttpHeaders . CONTENT_TYPE , MediaType . APPLICATION_JSON . toString ( ) ) . end ( data . encodePrettily ( ) ) ; LOGGER . error ( MessageCodes . AUTH_006 , request . method ( ) , request . absoluteURI ( ) , responseMessage ) ; }
Handle failure events sent by {@link #handle}.
Handle failure events sent by { @link #handle } .