com.canoris.api.exception
Class CanorisException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.canoris.api.exception.CanorisException
All Implemented Interfaces:
java.io.Serializable

public class CanorisException
extends java.lang.Exception

CanorisException is thrown when a JsonParseException occurs. We wrap the JsonParseException and extract the HTTP error code from the HttpResponse object. Essentially this is the only meaningful part of the response in case of an error.

Author:
stelios
See Also:
Serialized Form

Constructor Summary
CanorisException(int code, java.lang.String message)
          Parameterized constructor.
 
Method Summary
 int getHttpErrorCode()
           
 java.lang.String getHttpErrorMessage()
           
 void setHttpErrorCode(int httpErrorCode)
           
 void setHttpErrorMessage(java.lang.String httpErrorMessage)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CanorisException

public CanorisException(int code,
                        java.lang.String message)
Parameterized constructor.

Parameters:
code - The HTTP error code
message - The HTTP error message
Method Detail

setHttpErrorCode

public void setHttpErrorCode(int httpErrorCode)

getHttpErrorCode

public int getHttpErrorCode()

setHttpErrorMessage

public void setHttpErrorMessage(java.lang.String httpErrorMessage)

getHttpErrorMessage

public java.lang.String getHttpErrorMessage()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable