com.leanengine
Class LeanError

java.lang.Object
  extended by com.leanengine.LeanError

public class LeanError
extends java.lang.Object

Main error class containing all error codes.

There are four main types of errors:

1. Network error, when network connection is not available or server is not accessible.
2. Not authorized error, when user is not logged in.
3. Request error, indicating there are wrong parameters in request.
4. Server error, when server could not fulfill the request.

When an error occurs, the application should note the error type and notify the user accordingly.

Every error also contains the detailed error code and description, indicating the cause or error. This error codes and descriptions are not intended for end-user, but rather to pinpoint the cause of error.


Nested Class Summary
static class LeanError.Type
           
 
Method Summary
 int getErrorCode()
          Returns the detailed error code, indicating the cause of error.
 java.lang.String getErrorMessage()
          Returns the detailed error message, describing the cause of error.
 LeanError.Type getErrorType()
          Returns the type of error as described in LeanError.Type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getErrorCode

public int getErrorCode()
Returns the detailed error code, indicating the cause of error.

Returns:
Error code

getErrorType

public LeanError.Type getErrorType()
Returns the type of error as described in LeanError.Type

Returns:
LeanError.Type

getErrorMessage

public java.lang.String getErrorMessage()
Returns the detailed error message, describing the cause of error.

This error descriptions are not intended for end-user, instead they should be recorded in the error log, to later pin-point the cause of error.

Returns:
Description of error.