jaxrsResponse = executeExactExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = executeExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = handleWebApplicationException((WebApplicationException) e); jaxrsResponse = handleWriterException(request, (WriterException) e, logger); } else if (e instanceof ReaderException) jaxrsResponse = handleReaderException(request, (ReaderException) e, logger); } else jaxrsResponse = executeExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = handleFailure(request, (Failure) e); jaxrsResponse = handleApplicationException(request, (ApplicationException) e, logger); } else jaxrsResponse = executeExceptionMapper(e, logger);
protected Response handleWriterException(HttpRequest request, WriterException e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; // See if there is a general mapper for WriterException if ((jaxrsResponse = executeExceptionMapperForClass(e, WriterException.class, logger)) != null) { return jaxrsResponse; } if (e.getResponse() != null || e.getErrorCode() > -1) { return handleFailure(request, e); } else if (e.getCause() != null) { if ((jaxrsResponse = unwrapException(request, e, logger)) != null) return jaxrsResponse; } e.setErrorCode(HttpResponseCodes.SC_INTERNAL_SERVER_ERROR); return handleFailure(request, e); }
protected Response handleApplicationException(HttpRequest request, ApplicationException e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; // See if there is a mapper for ApplicationException if ((jaxrsResponse = executeExceptionMapperForClass(e, ApplicationException.class, logger)) != null) { return jaxrsResponse; } jaxrsResponse = unwrapException(request, e, logger); if (jaxrsResponse == null) { throw new UnhandledException(e.getCause()); } return jaxrsResponse; }
jaxrsResponse = executeExceptionMapper(unwrappedException, logger); return handleWebApplicationException((WebApplicationException) unwrappedException); return handleFailure(request, (Failure) unwrappedException); return unwrapException(request, unwrappedException, logger);
public Response preprocess(HttpRequest request) { RESTEasyTracingLogger.initTracingSupport(providerFactory, request); Response aborted = null; RESTEasyTracingLogger tracingLogger = RESTEasyTracingLogger.getInstance(request); try { final long totalTimestamp = tracingLogger.timestamp("PRE_MATCH_SUMMARY"); for (HttpRequestPreprocessor preprocessor : this.requestPreprocessors) { final long timestamp = tracingLogger.timestamp("PRE_MATCH"); preprocessor.preProcess(request); tracingLogger.logDuration("PRE_MATCH", timestamp, preprocessor.getClass().toString()); } tracingLogger.logDuration("PRE_MATCH_SUMMARY", totalTimestamp, this.requestPreprocessors.size()); ContainerRequestFilter[] requestFilters = providerFactory.getContainerRequestFilterRegistry().preMatch(); // FIXME: support async PreMatchContainerRequestContext requestContext = new PreMatchContainerRequestContext(request, requestFilters, null); aborted = requestContext.filter(); } catch (Exception e) { //logger.error("Failed in preprocess, mapping exception", e); aborted = new ExceptionHandler(providerFactory, unwrappedExceptions).handleException(request, e); } return aborted; }
@Deprecated @SuppressWarnings(value = "unchecked") public Response executeExceptionMapper(Throwable exception) { return executeExactExceptionMapper(exception, null); }
@Deprecated @SuppressWarnings(value = "unchecked") public Response executeExceptionMapperForClass(Throwable exception, Class clazz) { return executeExceptionMapperForClass(exception, clazz, null); }
if ((jaxrsResponse = executeExceptionMapper(unwrappedException)) != null) { return jaxrsResponse; return handleWebApplicationException((WebApplicationException) unwrappedException); return handleFailure(request, (Failure) unwrappedException); return unwrapException(request, unwrappedException);
jaxrsResponse = new ExceptionHandler(providerFactory, unwrappedExceptions).handleException(request, e.getCause()); if (jaxrsResponse == null) throw new UnhandledException(e.getCause()); jaxrsResponse = new ExceptionHandler(providerFactory, unwrappedExceptions).handleException(request, e); if (jaxrsResponse == null) throw new UnhandledException(e);
protected Response handleApplicationException(HttpRequest request, ApplicationException e) { Response jaxrsResponse = null; // See if there is a mapper for ApplicationException if ((jaxrsResponse = executeExceptionMapperForClass(e, ApplicationException.class)) != null) { return jaxrsResponse; } jaxrsResponse = unwrapException(request, e); if (jaxrsResponse == null) { throw new UnhandledException(e.getCause()); } return jaxrsResponse; }
@Deprecated @SuppressWarnings(value = "unchecked") public Response executeExactExceptionMapper(Throwable exception) { return executeExactExceptionMapper(exception, null); }
@Deprecated @SuppressWarnings(value = "unchecked") public Response executeExceptionMapperForClass(Throwable exception, Class clazz) { return executeExceptionMapperForClass(exception, clazz, null); }
if ((jaxrsResponse = executeExactExceptionMapper(e)) != null) return jaxrsResponse; return handleApplicationException(request, (ApplicationException) e); return handleWriterException(request, (WriterException) e); return handleReaderException(request, (ReaderException) e); if ((jaxrsResponse = executeExceptionMapper(e)) != null) { return jaxrsResponse; return handleWebApplicationException((WebApplicationException) e); return handleFailure(request, (Failure) e);
protected Response handleReaderException(HttpRequest request, ReaderException e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; // See if there is a general mapper for ReaderException if ((jaxrsResponse = executeExceptionMapperForClass(e, ReaderException.class, logger)) != null) { return jaxrsResponse; } if (e.getResponse() != null || e.getErrorCode() > -1) { return handleFailure(request, e); } else if (e.getCause() != null) { if ((jaxrsResponse = unwrapException(request, e, logger)) != null) return jaxrsResponse; } e.setErrorCode(HttpResponseCodes.SC_BAD_REQUEST); return handleFailure(request, e); }
jaxrsResponse = executeExceptionMapper(unwrappedException, logger); return handleWebApplicationException((WebApplicationException) unwrappedException); return handleFailure(request, (Failure) unwrappedException); return unwrapException(request, unwrappedException, logger);
return; Response handledResponse = new ExceptionHandler(providerFactory, unwrappedExceptions).handleException(request, e); if (handledResponse == null) throw new UnhandledException(e); if (!bufferExceptionEntity)
protected Response handleApplicationException(HttpRequest request, ApplicationException e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; // See if there is a mapper for ApplicationException if ((jaxrsResponse = executeExceptionMapperForClass(e, ApplicationException.class, logger)) != null) { return jaxrsResponse; } jaxrsResponse = unwrapException(request, e, logger); if (jaxrsResponse == null) { throw new UnhandledException(e.getCause()); } return jaxrsResponse; }
@Deprecated @SuppressWarnings(value = "unchecked") public Response executeExceptionMapper(Throwable exception) { return executeExactExceptionMapper(exception, null); }
jaxrsResponse = executeExactExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = executeExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = handleWebApplicationException((WebApplicationException) e); jaxrsResponse = handleWriterException(request, (WriterException) e, logger); } else if (e instanceof ReaderException) jaxrsResponse = handleReaderException(request, (ReaderException) e, logger); } else jaxrsResponse = executeExceptionMapper(e, logger); if (jaxrsResponse == null) jaxrsResponse = handleFailure(request, (Failure) e); jaxrsResponse = handleApplicationException(request, (ApplicationException) e, logger); } else jaxrsResponse = executeExceptionMapper(e, logger);
protected Response handleReaderException(HttpRequest request, ReaderException e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; // See if there is a general mapper for ReaderException if ((jaxrsResponse = executeExceptionMapperForClass(e, ReaderException.class, logger)) != null) { return jaxrsResponse; } if (e.getResponse() != null || e.getErrorCode() > -1) { return handleFailure(request, e); } else if (e.getCause() != null) { if ((jaxrsResponse = unwrapException(request, e, logger)) != null) return jaxrsResponse; } e.setErrorCode(HttpResponseCodes.SC_BAD_REQUEST); return handleFailure(request, e); }