ResolvablePlatformException

class ResolvablePlatformException(errorCode: Int?, errorMessage: String, val hasResolution: Boolean) : HealthDataException

An exception to indicate that the Samsung Health app is not ready to serve the specified operation.

In some cases, this error can be resolved by the user at runtime. It is strongly recommended for the app to show the right message to the user if hasResolution returns true and call a resolve method if the user agrees. Here is a sample code which checks if the thrown exception can be solved in this way:

try {
 //API call that can throw an exception
} catch (error: HealthDataException) {
     if (error is ResolvablePlatformException && error.hasResolution) {
         error.resolve(activity)
     }
}

The following error codes are defined and can be helpful to app developers.

Since

1.0.0

Parameters

errorCode

The code for this error.

errorMessage

The message for this error.

Constructors

Link copied to clipboard
constructor(errorCode: Int?, errorMessage: String, hasResolution: Boolean)

A constructor.

Properties

Link copied to clipboard

Returns whether this exception has a resolution.

Functions

Link copied to clipboard
fun resolve(activity: Activity)

Resolves the exception with an activity that is able to retrieve the user's feedback for possible error cases.

Preferences Submitted

You have successfully updated your cookie preferences.