Package org.jinstagram.exceptions

Examples of org.jinstagram.exceptions.InstagramException


        SubscriptionResponseObject[] responseData;

          try {
            responseData = gson.fromJson(jsonBody, SubscriptionResponseObject[].class);
          } catch (Exception e) {
              throw new InstagramException("Error parsing json to object type ");
          }

          return responseData;
    }
View Full Code Here


      byte[] result = mac.doFinal(rawJsonData);
      String encodedResult = Hex.encodeHexString(result);
     
      return new VerificationResult(encodedResult.equals(xHubSignature), encodedResult);
      } catch (NoSuchAlgorithmException e) {
      throw new InstagramException("Invalid algorithm name!", e);
    } catch (InvalidKeyException e){
      throw new InstagramException("Invalid key: " + clientSecret, e);
    }
    }
View Full Code Here

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to create subscription", e);
        }
  }
View Full Code Here

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to delete subscription with id ["+id+"]", e);
        }
    }
View Full Code Here

        try {
            final Response response = request.send();
            return getSubscriptionResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to delete all subscriptions", e);
        }
  }
View Full Code Here

        try {
            final Response response = request.send();
            return getSubscriptionsListResponse(response.getBody());
        } catch (IOException e) {
            throw new InstagramException("Failed to get subscription list", e);
        }
  }
View Full Code Here

        SubscriptionResponse response;

        try {
            response = gson.fromJson(jsonBody, SubscriptionResponse.class);
        } catch (Exception e) {
            throw new InstagramException("Error parsing json to object type ");
        }

        return response;
    }
View Full Code Here

        SubscriptionsListResponse response = null;

        try {
            response = gson.fromJson(jsonBody, SubscriptionsListResponse.class);
        } catch (Exception e) {
            throw new InstagramException("Error parsing json to object type ");
        }

        return response;
    }
View Full Code Here

        throws InstagramException {
            Response response;
            try {
                response = getApiResponse(verbs, methodName, params);
            } catch (IOException e) {
                throw new InstagramException("IOException while retrieving data", e);
            }

            if (response.getCode() >= 200 && response.getCode() < 300) {
                T object = createObjectFromResponse(clazz, response.getBody());
                object.setHeaders(response.getHeaders());
View Full Code Here

                error = InstagramErrorResponse.parse(gson, response.getBody());
                error.setHeaders(response.getHeaders());
                error.throwException();
            }
        } catch (JsonSyntaxException e) {
            throw new InstagramException("Failed to decode error response " + response.getBody(), e, response.getHeaders());
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
    }
View Full Code Here

TOP

Related Classes of org.jinstagram.exceptions.InstagramException

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.