Examples of UnexpectedResponseException


Examples of com.belladati.sdk.exception.server.UnexpectedResponseException

      case 404:
        throw new NotFoundException(request.getRequestLine().getUri());
      case 500:
        throw new InternalErrorException();
      default:
        throw new UnexpectedResponseException(statusCode, new String(content));
      }
    } catch (OAuthException e) {
      throw new InternalConfigurationException("Failed to create OAuth signature", e);
    } catch (IOException e) {
      throw new ConnectionException("Failed to connect to BellaDati", e);
View Full Code Here

Examples of com.belladati.sdk.exception.server.UnexpectedResponseException

              .split("-")[1]));
          }
        }
        return new AuthorizationException(Reason.OTHER, problem);
      }
      return new UnexpectedResponseException(code, new String(content));
    } catch (IOException e) {
      throw new UnexpectedResponseException(code, new String(content), e);
    }

  }
View Full Code Here

Examples of com.belladati.sdk.exception.server.UnexpectedResponseException

        Matcher codeMatcher = codePattern.matcher(e.getResponseContent());
        if (codeMatcher.matches()) {
          throw new UnknownServerColumnException(id, codeMatcher.group(1));
        }
      }
      throw new UnexpectedResponseException(e.getResponseCode(), e.getResponseContent(), e);
    }
  }
View Full Code Here

Examples of com.proofpoint.http.client.UnexpectedResponseException

                        request.getUri(),
                        statusCode,
                        response.getStatusMessage(),
                        bodyError.getMessage());
            }
            throw new UnexpectedResponseException(format("Posting event to %s failed", request.getUri()), request, response);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
View Full Code Here

Examples of io.airlift.http.client.UnexpectedResponseException

        @Override
        public URI handle(Request request, Response response)
        {
            if (response.getStatusCode() != HttpStatus.CREATED.code()) {
                throw new UnexpectedResponseException(
                        String.format("Expected response code to be 201 CREATED, but was %s %s", response.getStatusCode(), response.getStatusMessage()),
                        request,
                        response);
            }
            String location = response.getHeader("Location");
            if (location == null) {
                throw new UnexpectedResponseException("Response does not contain a Location header", request, response);
            }
            return URI.create(location);
        }
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.