/** * This method is used to turn a simple exception into an HttpError, * very useful in final implementations of this class. */ public static void rethrowAsHttpException (final int httpErrorCode, final Exception e) throws HttpException { throw new HttpException(httpErrorCode, e.getMessage()); }