Package com.cloudesire.tisana4j.ExceptionTranslator

Examples of com.cloudesire.tisana4j.ExceptionTranslator.ResponseMessage


        ContentType type = ContentType.getOrDefault(response.getEntity());
        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

TOP

Related Classes of com.cloudesire.tisana4j.ExceptionTranslator.ResponseMessage

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.