Class OkHiException

The OkHiException class extends the Error class to provide additional information regarding the type of errors thrown while running any OkHiLibraries. It contains static string properties that can be used to evaluate the kind of errors being thrown and handle them appropriately.

Hierarchy

  • Error
    • OkHiException

Constructors

Properties

cause?: unknown
code: string

Specific error code string detailing the kind of error being thrown.

message: string
name: string
stack?: string
BAD_REQUEST_CODE: string = 'bad_request'

Error is thrown whenever bad configuration is provided to an OkHi service.

BAD_REQUEST_MESSAGE: string = 'Invalid parameters provided'

Error is thrown whenever bad configuration is provided to an OkHi service.

INVALID_PHONE_CODE: string = 'invalid_phone'

Error is thrown whenever an invalid phone number is provided to a service that requires a user's phone number.

INVALID_PHONE_MESSAGE: string = 'Invalid phone number provided. Please make sure its in MSISDN standard format'

Error is thrown whenever an invalid phone number is provided to a service that requires a user's phone number.

LOCATION_SERVICES_UNAVAILABLE_CODE: string = 'location_services_unavailable'

Error is thrown when location services is unavailable.

NETWORK_ERROR_CODE: string = 'network_error'

Error is thrown when the device can't connect to OkHi's servers.

NETWORK_ERROR_MESSAGE: string = 'Unable to establish a connection with OkHi servers'

Error is thrown when the device can't connect to OkHi's servers.

PERMISSION_DENIED_CODE: string = 'permission_denied'

Error is thrown whenever a particular permission is required for a service to run and isn't granted by the user.

PLAY_SERVICES_UNAVAILABLE_CODE: string = 'play_services_unavailable'

Error is thrown when play services is unavailable.

SERVICE_UNAVAILABLE_CODE: string = 'service_unavailable'

Error is thrown whenever a particular device service is required for a library to run and isn't granted by the user.

UNAUTHORIZED_CODE: string = 'unauthorized'

Error is thrown whenever there's an issue with the credentials provided.

UNAUTHORIZED_MESSAGE: string = 'Invalid credentials provided'

Error is thrown whenever there's an issue with the credentials provided.

UNKNOWN_ERROR_CODE: string = 'unknown_error'

Error is thrown whenever there's an unknown error that occured during the usage of one of OkHi's services.

UNKNOWN_ERROR_MESSAGE: string = 'Unable to process the request. Something went wrong'

Error is thrown whenever there's an unknown error that occured during the usage of one of OkHi's services.

UNSUPPORTED_PLATFORM_CODE: string = 'unsupported_platform'

Error is thrown whenever an OkHi service is run on an unsupported platform.

UNSUPPORTED_PLATFORM_MESSAGE: string = 'Current platform is not supported'

Error is thrown whenever an OkHi service is run on an unsupported platform.

prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc