For AI agents: visit https://dev.wsc-sports.com/llms.txt for an index of all pages formatted in Markdown and endpoints in OpenAPI. Append .md to any documentation page URL to get its markdown version.
BlazeSDK provides structured and consistent error information through the BlazeResult.Error type. Errors can be delivered globally via the SDK delegate, locally via method completion handlers, or via source delegates for widgets, entryPoints, etc., depending on the context.
Error Structure
The BlazeResult.Error data class represents the public-facing error structure returned by the Blaze SDK.
data class Error(
val statusCode: Int,
val domain: ErrorDomain,
val reason: ErrorReason,
val message: String,
val metadata: Map<String, String>,
val cause: Throwable?
)
statusCode Optional HTTP or custom status code.
domain The domain or category of the error.
reason The specific reason for the error.
message Human-readable error message.
metadata Additional metadata related to the error.
cause The underlying exception that caused the error, if any.
Error Delivery Mechanisms
1. BlazeSDKDelegate
Errors marked as 'Thrown to Global Delegate' in the table below are automatically forwarded to your BlazeSDKDelegate implementation via the onErrorThrown callback.
// Example of handling error via BlazeSDKDelegate
private fun createBlazeSDKGlobalDelegate(): BlazeSDKDelegate {
return object : BlazeSDKDelegate {
override fun onEventTriggered(eventData: BlazeEventData) {
onGlobalEventTriggered(eventData)
}
override fun onErrorThrown(error: BlazeResult.Error) {
onGlobalErrorThrown(error)
}
}
}
private fun onGlobalErrorThrown(error: BlazeResult.Error) {
// Handle specific error domains and reasons
when (error.domain) {
ErrorDomain.INITIALIZATION -> {
handleInitializationError(error)
}
ErrorDomain.WIDGET -> {
handleWidgetError(error)
}
else -> {
// Handle other domains
}
}
}
2. Completion Handlers
Some errors are returned only through completion handlers for specific API calls (e.g., initialization, setting user ID, universal link processing). Therefore, in these cases, you should handle errors exclusively in the callback, as this is the only way to properly catch and respond to them.
// Error should be handled via completion callback
BlazeSDK.init(
apiKey = "your-api-key",
completionBlock = {
Log.d("Application", "BlazeSDK.init success completionBlock..")
},
errorBlock = { error ->
Log.e("Application", "BlazeSDK.init: errorBlock: Init Error = $error")
when (error.reason) {
ErrorReason.INVALID_API_KEY -> {
Log.e("Application", "BlazeSDK.init: errorBlock: Invalid API Key")
}
ErrorReason.SDK_ALREADY_INITIALIZED -> {
Log.e("Application", "BlazeSDK.init: errorBlock: SDK Already Initialized")
}
else -> {} // Handle other error reasons as needed
}
},
)
3. Source Delegates
Component-specific errors are delivered via source delegate onDataLoadComplete handlers for widgets, containers, and entry points:
BlazeWidgetDelegate → Widget load errors via onDataLoadComplete handler
BlazePlayerInContainerDelegate → Container load errors via onDataLoadComplete handler
BlazePlayerInInlineDelegate → Inline player load errors via onDataLoadComplete handler
BlazePlayerEntryPointDelegate → Entry point load errors via onDataLoadComplete handler
val widgetDelegate: BlazeWidgetDelegate = object : BlazeWidgetDelegate {
override fun onDataLoadStarted(playerType: BlazePlayerType, sourceId: String?) {
// handle onDataLoadStarted
}
override fun onDataLoadComplete(
playerType: BlazePlayerType,
sourceId: String?,
itemsCount: Int,
result: BlazeResult<Unit>
) {
when (result) {
is BlazeResult.Success -> {
// Handle successful load
}
is BlazeResult.Error -> {
handleWidgetError(result)
}
}
}
}
Notes
All errors marked with ✅ Yes are forwarded to the global delegate.