org.gbanga.api
Class APIException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.gbanga.api.APIException
All Implemented Interfaces:
java.io.Serializable

public class APIException
extends java.lang.Exception

An exception has occured while using the Gbanga Game API.

Author:
Matthias
See Also:
Serialized Form

Field Summary
static int ACCEPTED
          HTTP status code 202.
static int BAD_REQUEST
          HTTP status code 400.
 int code
          The HTTP status code.
 java.lang.String explanation
          A detailed explanation of the exception.
static int FORBIDDEN
          HTTP status code 403.
static int OK
          HTTP status code 200.
static int SERVER_ERROR
          HTTP status code 500.
 
Constructor Summary
APIException(int code)
          Creates an exception with the given error code.
APIException(int code, java.lang.String explanation)
          Creates an exception with the given code and explanation
APIException(java.lang.String explanation)
          Creates an exception with the given explanation.
APIException(java.lang.Throwable t)
          Creates an exception wrapping an existing Throwable.
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCEPTED

public static final int ACCEPTED
HTTP status code 202.

See Also:
Constant Field Values

BAD_REQUEST

public static final int BAD_REQUEST
HTTP status code 400.

See Also:
Constant Field Values

code

@PrimaryKey
public int code
The HTTP status code.


explanation

@HideIfNull
public java.lang.String explanation
A detailed explanation of the exception.


FORBIDDEN

public static final int FORBIDDEN
HTTP status code 403.

See Also:
Constant Field Values

OK

public static final int OK
HTTP status code 200.

See Also:
Constant Field Values

SERVER_ERROR

public static final int SERVER_ERROR
HTTP status code 500.

See Also:
Constant Field Values
Constructor Detail

APIException

public APIException(int code)
Creates an exception with the given error code.

Parameters:
code - a HTTP status code

APIException

public APIException(int code,
                    java.lang.String explanation)
Creates an exception with the given code and explanation

Parameters:
code - a HTTP status code
explanation - a detailed explanation

APIException

public APIException(java.lang.String explanation)
Creates an exception with the given explanation.

Parameters:
explanation - a detailed explanation

APIException

public APIException(java.lang.Throwable t)
Creates an exception wrapping an existing Throwable.

Parameters:
t - a Throwable that occured