Source:
static WebApplicationException wrap(final WebApplicationException e) { final ResteasyConfig config = ResteasyConfigFactory.getConfig(); final boolean originalBehavior = Boolean.parseBoolean(config.getValue(ResteasyContextParameters.RESTEASY_ORIGINAL_WEBAPPLICATIONEXCEPTION_BEHAVIOR, ResteasyConfig.SOURCE.SERVLET_CONTEXT, "false")); final boolean serverSide = ResteasyProviderFactory.searchContextData(Dispatcher.class) != null; if (originalBehavior || !serverSide) { return e; } if (e instanceof WebApplicationExceptionWrapper) { return e; } if (e instanceof BadRequestException) { return new ResteasyBadRequestException((BadRequestException) e); } if (e instanceof NotAuthorizedException) { return new ResteasyNotAuthorizedException((NotAuthorizedException) e); } if (e instanceof ForbiddenException) { return new ResteasyForbiddenException((ForbiddenException) e); } if (e instanceof NotFoundException) { return new ResteasyNotFoundException((NotFoundException) e); } if (e instanceof NotAllowedException) { return new ResteasyNotAllowedException((NotAllowedException) e); } if (e instanceof NotAcceptableException) { return new ResteasyNotAcceptableException((NotAcceptableException) e); } if (e instanceof NotSupportedException) { return new ResteasyNotSupportedException((NotSupportedException) e); } if (e instanceof InternalServerErrorException) { return new ResteasyInternalServerErrorException((InternalServerErrorException) e); } if (e instanceof ServiceUnavailableException) { return new ResteasyServiceUnavailableException((ServiceUnavailableException) e); } if (e instanceof ClientErrorException) { return new ResteasyClientErrorException((ClientErrorException) e); } if (e instanceof ServerErrorException) { return new ResteasyServerErrorException((ServerErrorException) e); } if (e instanceof RedirectionException) { return new ResteasyRedirectionException((RedirectionException) e); } return new ResteasyWebApplicationException(e); }

Target:
static WebApplicationException wrap(final WebApplicationException e) { ResteasyConfiguration config = ResteasyProviderFactory.getContextData(ResteasyConfiguration.class); boolean originalBehavior = false; try { final String s = config.getParameter(ResteasyContextParameters.RESTEASY_ORIGINAL_WEBAPPLICATIONEXCEPTION_BEHAVIOR); originalBehavior = (s != null && (s.isEmpty() || Boolean.parseBoolean(s))); } catch (Exception ignore) { } final boolean serverSide = ResteasyProviderFactory.searchContextData(Dispatcher.class) != null; if (originalBehavior || !serverSide) { return e; } if (e instanceof WebApplicationExceptionWrapper) { return e; } if (e instanceof BadRequestException) { return new ResteasyBadRequestException((BadRequestException) e); } if (e instanceof NotAuthorizedException) { return new ResteasyNotAuthorizedException((NotAuthorizedException) e); } if (e instanceof ForbiddenException) { return new ResteasyForbiddenException((ForbiddenException) e); } if (e instanceof NotFoundException) { return new ResteasyNotFoundException((NotFoundException) e); } if (e instanceof NotAllowedException) { return new ResteasyNotAllowedException((NotAllowedException) e); } if (e instanceof NotAcceptableException) { return new ResteasyNotAcceptableException((NotAcceptableException) e); } if (e instanceof NotSupportedException) { return new ResteasyNotSupportedException((NotSupportedException) e); } if (e instanceof InternalServerErrorException) { return new ResteasyInternalServerErrorException((InternalServerErrorException) e); } if (e instanceof ServiceUnavailableException) { return new ResteasyServiceUnavailableException((ServiceUnavailableException) e); } if (e instanceof ClientErrorException) { return new ResteasyClientErrorException((ClientErrorException) e); } if (e instanceof ServerErrorException) { return new ResteasyServerErrorException((ServerErrorException) e); } if (e instanceof RedirectionException) { return new ResteasyRedirectionException((RedirectionException) e); } return new ResteasyWebApplicationException(e); }