//Granify Android SDK/com.granifyinc.granifysdk/Granify/subscribeErrorReporting

subscribeErrorReporting

[androidJvm]\

@JvmStatic

fun subscribeErrorReporting(handler: (ErrorType, String) -> Unit)

Registers a callback handler to be notified when the Granify SDK has encountered an error it cannot resolve internally.

When the supplied handler is invoked, it indicates that the SDK is transitioning to an error state and will cease any further processing. Refer to the documentation of the provided ErrorType to determine the appropriate action to take. Some errors indicate incorrect API usage and require a code change, whereas others indicate runtime errors that may be handled with logic such as retrying an operation.

Expect your handler to be invoked by Granify at any time after activateGranify has been called. No guarantees are made regarding the thread the handler will be invoked on.

Placement

This function can be called at any time, but it is most usefully called prior to activateGranify to ensure a handler is registered in advance of any errors occurring.

Parameters

androidJvm

   
handler The callback to be invoked when an SDK error has occurred. An ErrorType will be supplied indicating the category of the error, and a message String providing additional human-readable context.