Class ProvisioningServiceError
- java.lang.Object
-
- com.gemalto.mfs.mwsdk.provisioning.model.ProvisioningServiceError
-
public class ProvisioningServiceError extends java.lang.Object
Errors pertaining to provisioning may have different causes. In some cases, the errors are linked to the HTTP protocol, others errors are handled and observed within the SDK such as having invalid credentials, while with other errors are linked to the CPS. This class allows the mobile wallet to understand the root cause of a provisioning error.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CPS_ERROR_CODE_DEFAULT
Default error codestatic int
HTTP_STATUS_CODE_DEFAULT
static int
HTTP_STATUS_CODE_NO_INTERNET
static int
HTTP_STATUS_TIMEOUT
static int
RAGES_COMMON_NO_INTERNET
static int
RAGES_CONNECTION_ERROR
static int
RAGES_CRYPTO_ERROR
static int
RAGES_INTERNAL_ERROR
static int
RAGES_INVALID_JSON_FORMAT_ERROR
static int
RAGES_SERVER_ERROR
static int
RAGES_STORAGE_ERROR
static int
RAGES_USER_NOT_ENROLLED
static int
REPERSO_TIMEOUT_ERROR
-
Constructor Summary
Constructors Constructor Description ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.lang.Throwable causingException, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo)
Constructor to create object of ProvisioningServiceError.ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.lang.Throwable causingException, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo, ProvisioningServiceError lastError)
Constructor to create object of ProvisioningServiceError.ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo)
Constructor to create object of ProvisioningServiceError.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getCausingException()
This methods returns the exception object that is responsible for the underlying issue.int
getCpsErrorCode()
Returns CPS error code.java.lang.String
getErrorMessage()
Returns the error message either from CPS or SDK.int
getHttpStatusCode()
Returns the http status code.ProvisioningServiceError
getLastError()
Return the last error if multiple errors during the API call.ProvisioningServiceErrorCodes
getSdkErrorCode()
Returns a code that can be associated with an error understood by the SDK.java.util.Map<java.lang.String,java.lang.String>
getStatusAdditionalInfo()
This is returned by the CPS on a failed processing of a request.java.lang.String
getTokenId()
Returns the string representation of the card token id if the error is related to a given card.
-
-
-
Field Detail
-
CPS_ERROR_CODE_DEFAULT
public static final int CPS_ERROR_CODE_DEFAULT
Default error code- See Also:
- Constant Field Values
-
HTTP_STATUS_CODE_DEFAULT
public static final int HTTP_STATUS_CODE_DEFAULT
- See Also:
- Constant Field Values
-
HTTP_STATUS_CODE_NO_INTERNET
public static final int HTTP_STATUS_CODE_NO_INTERNET
- See Also:
- Constant Field Values
-
HTTP_STATUS_TIMEOUT
public static final int HTTP_STATUS_TIMEOUT
- See Also:
- Constant Field Values
-
RAGES_INTERNAL_ERROR
public static final int RAGES_INTERNAL_ERROR
- See Also:
- Constant Field Values
-
REPERSO_TIMEOUT_ERROR
public static final int REPERSO_TIMEOUT_ERROR
- See Also:
- Constant Field Values
-
RAGES_COMMON_NO_INTERNET
public static final int RAGES_COMMON_NO_INTERNET
- See Also:
- Constant Field Values
-
RAGES_CONNECTION_ERROR
public static final int RAGES_CONNECTION_ERROR
- See Also:
- Constant Field Values
-
RAGES_SERVER_ERROR
public static final int RAGES_SERVER_ERROR
- See Also:
- Constant Field Values
-
RAGES_INVALID_JSON_FORMAT_ERROR
public static final int RAGES_INVALID_JSON_FORMAT_ERROR
- See Also:
- Constant Field Values
-
RAGES_STORAGE_ERROR
public static final int RAGES_STORAGE_ERROR
- See Also:
- Constant Field Values
-
RAGES_USER_NOT_ENROLLED
public static final int RAGES_USER_NOT_ENROLLED
- See Also:
- Constant Field Values
-
RAGES_CRYPTO_ERROR
public static final int RAGES_CRYPTO_ERROR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProvisioningServiceError
public ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo)
Constructor to create object of ProvisioningServiceError.- Parameters:
sdkErrorCodes
- error code as defined inProvisioningServiceErrorCodes
httpStatusCode
- the http status codecpsErrorCode
- error code as defined inKnownCpsErrorCodes
tokenId
- the tokenized card id if the error can be associated to a digitalized card. If not, this is null.errorMessage
- string describing the error that occurredstatusAdditionInfo
- This is an optional field, which will contain complimentary information on the error that occurred. This value is provided by the CPS. For example, for a wrong activation code input, this HashMap will contain a key called "remainingTries" which will indicate the total number of tries that the end user has to correctly enter the activation code.
-
ProvisioningServiceError
public ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.lang.Throwable causingException, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo, ProvisioningServiceError lastError)
Constructor to create object of ProvisioningServiceError.- Parameters:
sdkErrorCodes
- error code as defined inProvisioningServiceErrorCodes
httpStatusCode
- the http status codecpsErrorCode
- error code as defined inKnownCpsErrorCodes
tokenId
- the tokenized card id if the error can be associated to a digitalized card. If not, this is null.errorMessage
- string describing the error that occurredcausingException
- causing Exception for the errorstatusAdditionInfo
- This is an optional field, which will contain complimentary information on the error that occurred. This value is provided by the CPS. For example, for a wrong activation code input, this HashMap will contain a key called "remainingTries" which will indicate the total number of tries that the end user has to correctly enter the activation code.lastError
- PreviousProvisioningServiceError
before the current error if multiple errors during the request.
-
ProvisioningServiceError
public ProvisioningServiceError(ProvisioningServiceErrorCodes sdkErrorCodes, int httpStatusCode, int cpsErrorCode, java.lang.String tokenId, java.lang.String errorMessage, java.lang.Throwable causingException, java.util.Map<java.lang.String,java.lang.String> statusAdditionInfo)
Constructor to create object of ProvisioningServiceError.- Parameters:
sdkErrorCodes
- error code as defined inProvisioningServiceErrorCodes
httpStatusCode
- the http status codecpsErrorCode
- error code as defined inKnownCpsErrorCodes
tokenId
- the tokenized card id if the error can be associated to a digitalized card. If not, this is null.errorMessage
- string describing the error that occurredcausingException
- * causing Exception for the errorstatusAdditionInfo
- This is an optional field, which will contain complimentary information on the error that occurred. This value is provided by the CPS. For example, for a wrong activation code input, this HashMap will contain a key called "remainingTries" which will indicate the total number of tries that the end user has to correctly enter the activation code.
-
-
Method Detail
-
getSdkErrorCode
public ProvisioningServiceErrorCodes getSdkErrorCode()
Returns a code that can be associated with an error understood by the SDK. It is through this error code which will help the mobile wallet understand the root cause of the provisioning error.- Returns:
- an error code of type
ProvisioningServiceErrorCodes
-
getHttpStatusCode
public int getHttpStatusCode()
Returns the http status code.- Returns:
- an int representation of the http status code.
-
getCpsErrorCode
public int getCpsErrorCode()
Returns CPS error code.- Returns:
- returns an error code of type
KnownCpsErrorCodes
-
getTokenId
public java.lang.String getTokenId()
Returns the string representation of the card token id if the error is related to a given card. Otherwise, this is null.- Returns:
- The token id of the card, if any. Otherwise, this returns null.
-
getErrorMessage
public java.lang.String getErrorMessage()
Returns the error message either from CPS or SDK.- Returns:
- String - error message recieved from server
-
getStatusAdditionalInfo
public java.util.Map<java.lang.String,java.lang.String> getStatusAdditionalInfo()
This is returned by the CPS on a failed processing of a request. This hashmap is optional. If available, this will contain a list of key-value pairs which is expected to compliment the error from the CPS.- Returns:
- Map containing additional information on the error that has occurred. This is taken from the CPS response.
-
getCausingException
public java.lang.Throwable getCausingException()
This methods returns the exception object that is responsible for the underlying issue. It can be null.- Returns:
- the throwable
-
getLastError
@Nullable public ProvisioningServiceError getLastError()
Return the last error if multiple errors during the API call. Errors will be chained in this object. Return null if there is no more other error. This is mainly used for the API callProvisioningBusinessService.processIncomingMessage(Bundle, PushServiceListener)
where it could process multiple commands one after another.- Returns:
- the previous provisioningError object
- Since:
- 6.7.0
-
-