Package javax.ws.rs

Examples of javax.ws.rs.ClientErrorException


    }
    private void reportError(String message, Exception ex, int status) {
        LOG.warning(message);
        Response response = Response.status(status).type("text/plain").entity(message).build();
        if (ex == null) {
            throw status < 500 ? new ClientErrorException(response) : new ServerErrorException(response);
        } else {
            throw status < 500 ? new ClientErrorException(response, ex) : new ServerErrorException(response, ex);
        }
    }
View Full Code Here


            result = createFromParameterHandler(value, cls, message);
            if (result == null) {
                LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
                                                                   BUNDLE,
                                                                   pClass.getName()).toString());
                throw new ClientErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

        if (!"OPTIONS".equalsIgnoreCase(httpMethod) && logNow) {
            LOG.warning(errorMsg.toString());
        }
        Response response =
            createResponse(resource, message, errorMsg.toString(), status, methodMatched == 0);
        throw new ClientErrorException(response);
       
    }   
View Full Code Here

        switch (statusFamily) {
            case REDIRECTION:
                webAppException = new RedirectionException(response);
                break;
            case CLIENT_ERROR:
                webAppException = new ClientErrorException(response);
                break;
            case SERVER_ERROR:
                webAppException = new ServerErrorException(response);
                break;
            default:
View Full Code Here

        @Path("throwable")
        @GET
        public String throwsThrowable() throws Throwable {
            throw new Throwable("throwable",
                    new RuntimeException("runtime-exception",
                            new ClientErrorException("client-error", 499)));
        }
View Full Code Here

            result = createFromParameterHandler(value, cls, message);
            if (result == null) {
                LOG.severe(new org.apache.cxf.common.i18n.Message("CLASS_CONSTRUCTOR_FAILURE",
                                                                   BUNDLE,
                                                                   pClass.getName()).toString());
                throw new ClientErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

        if (!"OPTIONS".equalsIgnoreCase(httpMethod) && logNow) {
            LOG.warning(errorMsg.toString());
        }
        Response response =
            createResponse(resource, message, errorMsg.toString(), status, methodMatched == 0);
        throw new ClientErrorException(response);
       
    }   
View Full Code Here

            throw new ServiceUnavailableException(response);
         default:
            break;
      }

      if (status >= 400 && status < 500) throw new ClientErrorException(response);
      if (status >= 500) throw new ServerErrorException(response);


      throw new WebApplicationException(response);
   }
View Full Code Here

      @GET
      @Path("throwable")
      public String throwable() throws Throwable
      {
         throw new Throwable(new RuntimeException(new ClientErrorException(499)));
      }
View Full Code Here

        switch (statusFamily) {
            case REDIRECTION:
                webAppException = new RedirectionException(response);
                break;
            case CLIENT_ERROR:
                webAppException = new ClientErrorException(response);
                break;
            case SERVER_ERROR:
                webAppException = new ServerErrorException(response);
                break;
            default:
View Full Code Here

TOP

Related Classes of javax.ws.rs.ClientErrorException

Copyright © 2018 www.massapicom. 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.