Examples of toResponse()


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

    */
   public boolean executeExactExceptionMapper(HttpRequest request, HttpResponse response, Throwable exception)
   {
      ExceptionMapper mapper = providerFactory.getExceptionMapper(exception.getClass());
      if (mapper == null) return false;
      writeFailure(request, response, mapper.toResponse(exception));
      return true;
   }

   /**
    * Execute an ExceptionMapper if one exists for the given exception.  Recurse to base class if not found
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(request, 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()

               }
               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()

       
        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()

       
        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()

       
        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
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.