Examples of toResponse()


Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

        if (cause != null) {

            final ExceptionMapper mapper = mappers.get().findMapping(cause);
            if (mapper != null && mapper != this) {

                return mapper.toResponse(cause);

            } else if (cause instanceof WebApplicationException) {

                return ((WebApplicationException)cause).getResponse();
            }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

      {
         return Response.serverError().build();
      }
      else
      {
         return mapper.toResponse(exception.getCausedByException());
      }
   }
}
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

               // -----
               if (errorResponse.getEntity() == null)
               {
                  if (excmap != null)
                  {
                     errorResponse = excmap.toResponse(e);
                  }
                  else
                  {
                     if (e.getMessage() != null)
                     {
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

                  if (LOG.isDebugEnabled())
                  {
                     // Hide error message if exception mapper exists.
                     LOG.warn("Internal error occurs.", cause);
                  }
                  response.setResponse(excmap.toResponse(e.getCause()));
               }
               else
               {
                  LOG.error("Internal error occurs.", cause);
                  throw new UnhandledException(e.getCause());
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

        if (cause != null) {

            final ExceptionMapper mapper = mappers.get().findMapping(cause);
            if (mapper != null && mapper != this) {

                return mapper.toResponse(cause);

            } else if (cause instanceof WebApplicationException) {

                return ((WebApplicationException)cause).getResponse();
            }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

    @Override
    public Response toResponse(TransactionalException exception) {
        final ExceptionMapper mapper = mappers.get().findMapping(exception);

        if (mapper != null && !TransactionalExceptionMapper.class.isAssignableFrom(mapper.getClass())) {
            return mapper.toResponse(exception);
        } else {
            if (waeHolder != null) {
                final WebApplicationException wae = waeHolder.exception;
                if (wae != null) {
                    return wae.getResponse();
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

         mapper = providerFactory.getExceptionMapper(causeClass);
         if (mapper == null) causeClass = causeClass.getSuperclass();
      }
      if (mapper != null)
      {
         writeFailure(response, mapper.toResponse(exception));
         return true;
      }
      return false;
   }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(inMessage).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            try {
                return mapper.toResponse(ex);
            } catch (Exception mapperEx) {
                mapperEx.printStackTrace();
                return Response.serverError().build();
            }
        }
View Full Code Here

Examples of javax.ws.rs.ext.ExceptionMapper.toResponse()

    public static Response convertFaultToResponse(Throwable ex, String baseAddress, Message inMessage) {
       
        ExceptionMapper mapper =
            ProviderFactory.getInstance(baseAddress).createExceptionMapper(ex.getClass(), inMessage);
        if (mapper != null) {
            Response excResponse = mapper.toResponse(ex);
            if (excResponse != null) {
                return excResponse;
            }
        } else if (ex instanceof WebApplicationException) {
            WebApplicationException wex = (WebApplicationException)ex;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.