com.tumblr.jumblr.exceptions
Class JumblrException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.tumblr.jumblr.exceptions.JumblrException
All Implemented Interfaces:
Serializable

public class JumblrException
extends RuntimeException

This exception class is for any connection issue, it attempts to pull a message out of the JSON response is possible

Author:
jc
See Also:
Serialized Form

Constructor Summary
JumblrException(org.scribe.model.Response response)
          Instantiate a new JumblrException given a bad response to wrap
 
Method Summary
 List<String> getErrors()
          Get the errors returned from the API
 String getMessage()
          Get the message for this error
 int getResponseCode()
          Get the HTTP response code for this error
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JumblrException

public JumblrException(org.scribe.model.Response response)
Instantiate a new JumblrException given a bad response to wrap

Parameters:
response - the response to wrap
Method Detail

getResponseCode

public int getResponseCode()
Get the HTTP response code for this error

Returns:
the response code

getMessage

public String getMessage()
Get the message for this error

Overrides:
getMessage in class Throwable
Returns:
the message

getErrors

public List<String> getErrors()
Get the errors returned from the API

Returns:
List errors (or null if none)


Copyright © 2013. All Rights Reserved.