Package javax.ws.rs

Examples of javax.ws.rs.ServerErrorException


    public static WebApplicationException toHttpException(Throwable cause, Response response) {
       
        if (response == null) {
            throw new WebApplicationException(cause);
        }
        throw response.getStatus() >= 500 ? new ServerErrorException(response, cause)
            : new ClientErrorException(response, cause);
    }
View Full Code Here


    public static WebApplicationException toHttpException(Throwable cause, Response response) {
       
        if (response == null) {
            throw new WebApplicationException(cause);
        }
        throw response.getStatus() >= 500 ? new ServerErrorException(response, cause)
            : new ClientErrorException(response, cause);
    }
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 ServerErrorException(HttpUtils.getParameterFailureStatus(pType), ex);
            }
        }
        if (result == null) {
            // check for valueOf(String) static methods
            String[] methodNames = cls.isEnum()
View Full Code Here

                break;
            case CLIENT_ERROR:
                webAppException = new ClientErrorException(response);
                break;
            case SERVER_ERROR:
                webAppException = new ServerErrorException(response);
                break;
            default:
                webAppException = new WebApplicationException(response);
        }
        return webAppException;
View Full Code Here

    }
    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

    }
    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

    }
    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

    }
    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

                break;
            case CLIENT_ERROR:
                webAppException = new ClientErrorException(response);
                break;
            case SERVER_ERROR:
                webAppException = new ServerErrorException(response);
                break;
            default:
                webAppException = new WebApplicationException(response);
        }
        return webAppException;
View Full Code Here

         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

TOP

Related Classes of javax.ws.rs.ServerErrorException

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.