Package javax.ws.rs.ext

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


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

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

   public Response executeExactExceptionMapper(Throwable exception)
   {
      ExceptionMapper mapper = providerFactory.getExceptionMappers().get(exception.getClass());
      if (mapper == null) return null;
      mapperExecuted = true;
      return mapper.toResponse(exception);
   }


   public Response executeExceptionMapperForClass(Throwable exception, Class clazz)
   {
View Full Code Here

   public Response executeExceptionMapperForClass(Throwable exception, Class clazz)
   {
      ExceptionMapper mapper = providerFactory.getExceptionMappers().get(clazz);
      if (mapper == null) return null;
      mapperExecuted = true;
      return mapper.toResponse(exception);
   }

   protected Response handleApplicationException(HttpRequest request, ApplicationException e)
   {
      Response jaxrsResponse = null;
View Full Code Here

         mapper = providerFactory.getExceptionMappers().get(causeClass);
         if (mapper == null) causeClass = causeClass.getSuperclass();
      }
      if (mapper != null) {
         mapperExecuted = true;
         Response jaxrsResponse = mapper.toResponse(exception);
         if (jaxrsResponse == null) {
            jaxrsResponse = Response.status(204).build();
         }
         return jaxrsResponse;
      }
View Full Code Here

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

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

       
        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

               }
               if (errorResponse.getEntity() == null)
               {
                  if (excmap != null)
                  {
                     errorResponse = excmap.toResponse(e);
                  }
                  else
                  {
                     if (e.getMessage() != null)
                     {
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.