public class

PMError

extends Exception
implements Parcelable
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ com.paymill.android.service.PMError

Class Overview

This is the exception that is returned in every unsuccessful asynchronous callback. There are several types of this error. A detail message may also exist.

Summary

Nested Classes
enum PMError.BridgeError The type of the bridge error. 
enum PMError.SafeStoreError The type of the safe store error. 
enum PMError.Type Type of the error that the SDK returns  
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PMError> CREATOR
Public Constructors
PMError(PMError.Type type)
Creates new PMError with a type and empty message
PMError(PMError.Type type, String message)
Creates new PMError
PMError(String message, int httpCode)
Creates new PMError of type API.
PMError(PMError.BridgeError type, String message)
Creates new PMError of type BRIDGE.
PMError(PMError.SafeStoreError type, String message)
Creates new PMError of type SAFE_STORE.
PMError(Parcel in)
Public Methods
int describeContents()
PMError.BridgeError getBridgeError()
Returns the exact BridgeError.
int getHttpCode()
Return the HTTP code of the request, caused this error.
String getMessage()
Return a detail message about this error.
PMError.SafeStoreError getSafeStoreError()
Returns the exact SafeStoreError.
PMError.Type getType()
Returns the type of this error.
void readFromParcel(Parcel in)
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<PMError> CREATOR

Public Constructors

public PMError (PMError.Type type)

Creates new PMError with a type and empty message

Parameters
type the type

public PMError (PMError.Type type, String message)

Creates new PMError

Parameters
type the type
message the message

public PMError (String message, int httpCode)

Creates new PMError of type API.

Parameters
message the message
httpCode the http code returned when generating this request. May be 0 or less, if none is available.

public PMError (PMError.BridgeError type, String message)

Creates new PMError of type BRIDGE.

Parameters
type the exact bridge error type
message the detailed message

public PMError (PMError.SafeStoreError type, String message)

Creates new PMError of type SAFE_STORE.

Parameters
type the exact safe store error type
message the detailed message

public PMError (Parcel in)

Public Methods

public int describeContents ()

public PMError.BridgeError getBridgeError ()

Returns the exact BridgeError.

Returns
  • the exact bridge error or null if none is available

public int getHttpCode ()

Return the HTTP code of the request, caused this error.
Note: The HTTP code exists only for API type errors.

Returns
  • the HTTP code or 0 or less if none is available.

public String getMessage ()

Return a detail message about this error.
Note: This is a developer message. It may include a whole stacktrace of an exception thrown inside the SDK. Consider using the type of the error to handle messages for the end user.

Returns
  • an empty string or the detail message

public PMError.SafeStoreError getSafeStoreError ()

Returns the exact SafeStoreError.

Returns
  • the exact safe store error or null if none is available

public PMError.Type getType ()

Returns the type of this error.

Returns
  • the type
See Also

public void readFromParcel (Parcel in)

public String toString ()

public void writeToParcel (Parcel dest, int flags)