AIError

Superclass:
NSObject
Version:
1.0
Declared In:

Introduction

This class encapsulates the error information generated by the SDK. An AIError object includes the error code and a meaningful error message.



Constants

kAIAccessDenied

The resource owner or authorization server denied the request.

kAIApplicationNotAuthorized

A valid refresh token was not found.

kAIDeviceError

The SDK encountered an error on the device.

kAIErrorUserInterrupted

The user canceled the login page.

kAIInternalError

An internal error occured in the SDK.

kAIInvalidInput

One of the API parameters is invalid.

kAINetworkError

A network error occurred, possibly due to the user being offline.

kAINoError

No error code.

kAIServerError

An error occured on the server.

kAIUnauthorizedClient

The client is not authorized to request an authorization code using this method.


kAIAccessDenied


The resource owner or authorization server denied the request.

extern const NSUInteger kAIAccessDenied; 
Discussion

The user declined to authorize the application on the consent page.

In general on getting this type of error, the application can call authorizeUserForScopes:delegate: to request authorization. The following APIs return this error: 1. authorizeUserForScopes:delegate:

Availability
1.0

kAIApplicationNotAuthorized


A valid refresh token was not found.

extern const NSUInteger kAIApplicationNotAuthorized; 
Discussion

The refresh token held by the SDK is invalid, expired, revoked, does not match the redirection URI used in the authorization request, does not have the required scopes, or was issued to another client.

In general with this type of error, the application can call authorizeUserForScopes:delegate: to request authorization, or call clearAuthorizationState: to logout the user.

The following APIs return this error:

  1. getProfile:

  2. getAccessTokenForScopes:withOverrideParams:delegate:

Availability
1.0

kAIDeviceError


The SDK encountered an error on the device.

extern const NSUInteger kAIDeviceError; 
Discussion

Currently, the SDK only throws this error when it receives the some error from the keychain service.

In general on getting this type of error, the application can call clearAuthorizationState: to reset the KeyChain.

The following APIs return this error:

  1. getProfile:

  2. getAccessTokenForScopes:withOverrideParams:delegate:

  3. authorizeUserForScopes:delegate:

Availability
1.0

kAIErrorUserInterrupted


The user canceled the login page.

extern const NSUInteger kAIErrorUserInterrupted; 
Discussion

The user pressed cancel while on the login or the consent page.

In general on getting this type of error, the application can allow user to login again. The following APIs return this error: 1. authorizeUserForScopes:delegate:

Availability
1.0

kAIInternalError


An internal error occured in the SDK.

extern const NSUInteger kAIInternalError; 
Discussion

In general, these errors cannot be handled by application. Please contact us to report recurring internal errors.

The following APIs return this error:

  1. getProfile:

  2. getAccessTokenForScopes:withOverrideParams:delegate:

  3. authorizeUserForScopes:delegate:


kAIInvalidInput


One of the API parameters is invalid.

extern const NSUInteger kAIInvalidInput; 
Discussion

The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.

Check your method parameters and try again. This error is expected from all APIs.

Availability
1.0

kAINetworkError


A network error occurred, possibly due to the user being offline.

extern const NSUInteger kAINetworkError; 
Discussion

In general on getting this error the application can ask the user to check their network connections.

The following APIs return this error:

  1. getProfile:

  2. getAccessTokenForScopes:withOverrideParams:delegate:

  3. authorizeUserForScopes:delegate:

Availability
1.0

kAINoError


No error code.

extern const NSUInteger kAINoError; 
Discussion

Initial value to which the error object is initialized.

Availability
1.0

kAIServerError


An error occured on the server.

extern const NSUInteger kAIServerError; 
Discussion

The server encountered an error while completing the request, or the SDK received an unknown response from the server.

In general on getting this type of error, the application can allow user to retry the last action. The following APIs return this error:

  1. getProfile:

  2. getAccessTokenForScopes:withOverrideParams:delegate:

  3. authorizeUserForScopes:delegate:

Availability
1.0

kAIUnauthorizedClient


The client is not authorized to request an authorization code using this method.

extern const NSUInteger kAIUnauthorizedClient; 
Discussion

The application is not authorized to make this call. Make sure the registered Bundle identifier matches your application, and that you have a valid APIKey property in the application property list.

The following APIs return this error:

  1. getAccessTokenForScopes:withOverrideParams:delegate:

  2. authorizeUserForScopes:delegate:

Availability
1.0

Properties

code

The error code for the error encountered by the API.

message

The readable message corresponding to the error code.


code


The error code for the error encountered by the API.

@property NSUInteger code; 
Availability
1.0

message


The readable message corresponding to the error code.

@property (retain) NSString* message; 
Discussion

The message provides more information about the exact type of error encountered by the API.

Availability
1.0