Package org.jinstagram.exceptions

Examples of org.jinstagram.exceptions.InstagramException


            try {
                object = clazz.newInstance();
      object = gson.fromJson(response, clazz);
    }
    catch (InstantiationException e) {
      throw new InstagramException("Problem in Instantiation of type " + clazz.getName(), e);
    }
    catch (IllegalAccessException e) {
      throw new InstagramException("Couldn't create object of type " + clazz.getName(), e);
    }
    catch (Exception e) {
      throw new InstagramException("Error parsing json to object type " + clazz.getName(), e);
    }

    return object;
  }
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());
View Full Code Here

            Gson gson = new Gson();
            final InstagramErrorResponse error = InstagramErrorResponse.parse(gson, response.getBody());
            error.setHeaders(response.getHeaders());
            error.throwException();
        }
        throw new InstagramException("Unknown error response code: " + response.getCode() + " " + response.getBody(), response.getHeaders());
    }
View Full Code Here

        try {
            object = clazz.newInstance();
            object = gson.fromJson(response, clazz);
        }
        catch (InstantiationException e) {
            throw new InstagramException("Problem in Instantiation of type " + clazz.getName(), e);
        }
        catch (IllegalAccessException e) {
            throw new InstagramException("Couldn't create object of type " + clazz.getName(), e);
        }
        catch (Exception e) {
            throw new InstagramException("Error parsing json to object type " + clazz.getName(), e);
        }

        return object;
    }
View Full Code Here

            mac.init(keySpec);
            byte[] result = mac.doFinal(message.getBytes(Charset.forName("UTF-8")));
            String encodedResult = Hex.encodeHexString(result);
            return 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

                    throw new InstagramBadRequestException(msg, this.headers);
                case 429:
                    throw new InstagramRateLimitException(msg, this.headers);
            }

            throw new InstagramException(msg, this.headers);
        } else {
            throw new InstagramException("No metadata found in response", this.headers);
        }
    }
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.