A class of errors that can occur when using the MapsIndoors SDK.

Export

Hierarchy

  • MPError

Constructors

  • Creates an instance of MPError.

    Parameters

    • code: number

      The errors code, this will be a MapsIndoors error code.

      If unsure of the code, check the native SDK.

    • message: string

      A descriptive message of what caused the error.

    • Optional status: number

      An optional status code, this will in case of network issues be the response code.

    • Optional tag: any

      Optional object tag.

    Returns MPError

Properties

code: number

The errors code, this will be a MapsIndoors error code.

If unsure of the code, check the native SDK.

message: string

A descriptive message of what caused the error.

status?: number

An optional status code, this will in case of network issues be the response code.

tag?: any

Optional object tag.

baseMapCacheNotRegistered: number = 9001

Occurs if base-map tile caching is attempted before a map provider's base-map cache has been registered with the SDK.

Static

baseMapCachingNotSupported: number = 9000

Occurs if base-map tile caching is attempted on a map provider that cannot cache base-map tiles. The Mapbox provider supports it; the Google Maps provider does not.

Canonical copy. The same value is spelled out in Android's MIError.BASEMAP_CACHE_NOT_SUPPORTED and as a literal in iOS's doRejectBaseMapCache; drift silently reports "not supported" as a generic failure.

Static

invalidApiKey: number = 100

Occurs if the supplied API key is not a valid MapsIndoors key.

Static

networkError: number = 10

Occurs when an internet connection is required, or if the content server is unresponsive.

Static

sdkNotInitialized: number = 22

Occurs if some functions are called before the SDK has been initialized.

Static

unknownError: number = 20

Occurs if an unknown exception is caught.

Static

Methods

  • Creator for MPError, used to decode JSON from the MapsIndoors SDK.

    Parameters

    • object: MPErrorParams

    Returns MPError

    Static

  • Turn a rejection from a native module into an MPError.

    The native modules reject with a JSON-encoded MPError, but a rejection reaching here can also come from the bridge itself or from JavaScript, and then the message is plain text. Parsing that blindly threw a SyntaxError and threw away the real message, so a caller saw "JSON Parse error: Unexpected character: E" instead of what actually went wrong. Fall back to wrapping the message as an unknown error, which keeps it readable and keeps this method's contract - it returns an MPError, it does not throw a different one.

    Parameters

    • error: Error

    Returns MPError

    Static

Generated using TypeDoc