/** * Logs and gets error call back on the response with the provided error message. * * @param message The error message passed to the logger and the exception * @param query The query with the schema for processing this response */ private void logAndGetErrorCallback(String message, DruidAggregationQuery<?> query) { LOG.error(message); getErrorCallback(query).dispatch( Status.INTERNAL_SERVER_ERROR.getStatusCode(), "The server encountered an unexpected condition which prevented it from fulfilling the request.", message); }
/** * Logs and gets error call back on the response with the provided error message. * * @param message The error message passed to the logger and the exception * @param query The query with the schema for processing this response */ private void logAndGetErrorCallback(String message, DruidAggregationQuery<?> query) { LOG.error(message); getErrorCallback(query).dispatch( INTERNAL_SERVER_ERROR.getStatusCode(), ErrorMessageFormat.INTERNAL_SERVER_ERROR_REASON_PHRASE.format(), message ); } }
@Override public boolean handleRequest( final RequestContext context, final DataApiRequest request, final DruidAggregationQuery<?> druidQuery, final ResponseProcessor response ) { if (request.getFormat() != DefaultResponseFormatType.DEBUG) { return next.handleRequest(context, request, druidQuery, response); } response.getErrorCallback(druidQuery).dispatch(200, request.getFormat().toString(), "DEBUG"); return true; } }
response.getErrorCallback(druidQuery).dispatch( 507, // Insufficient Storage reason,
String message = EMPTY_INTERVAL_FORMAT.format(request.getIntervals()); int badRequestCode = Response.Status.BAD_REQUEST.getStatusCode(); response.getErrorCallback(druidQuery).dispatch(badRequestCode, message, message); return true;