Package com.cloudesire.tisana4j.exceptions

Examples of com.cloudesire.tisana4j.exceptions.RestException


        String charset = type.getCharset() != null ? type.getCharset().name() : "UTF-8";

        String errorStream = IOUtils.toString(stream, charset);

        ResponseMessage responseMessage = new ResponseMessage();
        RestException translatedException = exceptionTranslator.translateException(responseCode, response
          .getStatusLine().getReasonPhrase(), errorStream, responseMessage);

        if (translatedException != null) throw translatedException;

        throw getDefaultException(responseCode, response.getStatusLine().getReasonPhrase(), responseMessage.getResponse() );

      } catch (IllegalStateException | IOException e)
      {
        throw new RestException(responseCode, e.getMessage());
      }

    }
  }
View Full Code Here


    case 422:
      return new UnprocessableEntityException(responseCode, msgError);
    case 500:
      return new InternalServerErrorException(responseCode, msgError);
    }
    return new RestException(responseCode, msgError);
  }
View Full Code Here

TOP

Related Classes of com.cloudesire.tisana4j.exceptions.RestException

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.