The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.

Dev guideAPI Reference
Dev guideAPI ReferenceUser GuideLegal TermsGitHubNuGetDev CommunitySubmit a ticketLog In

Customize the Android SDK error handler

How to create your own error handler logic for the Optimizely Feature Experimentation Android SDK.

To standardize error reporting across your production environment, you can provide your own custom error handler logic in the Optimizely Feature Experimentation Android SDK.

This error handler is called when an unknown feature flag key is referenced.

See the code example below. If the error handler is not overridden, a no-op error handler is used by default.

// Error handler that raises exceptions
val errorHandler: ErrorHandler = RaiseExceptionErrorHandler()

val optimizelyManager = OptimizelyManager.builder()
         .withSDKKey("<Your_SDK_Key>")
         .withErrorHandler(errorHandler)
         .withDatafileDownloadInterval(15, TimeUnit.MINUTES)
         .build(context)
// Error handler that raises exceptions
ErrorHandler errorHandler = new RaiseExceptionErrorHandler();

OptimizelyManager optimizelyManager = OptimizelyManager.builder()
        .withSDKKey("<Your_SDK_Key>")
        .withErrorHandler(errorHandler)
        .withDatafileDownloadInterval(15, TimeUnit.MINUTES)
        .build(context);