Exceptions

Exceptions

The Smart-Spaces SDK does not throw any exception, but it can return as part of the Response when the status is Fail.
Besides some common java exceptions such as IllegalStateException, IllegalArgumentException and IOException, there are a few SDK specific exceptions.
All of them extend from the Kotlin sealed class SmartSpacesSdkException.

CanceledException

That’s the default exception given on the CancellationSignal.cancel() call.
This exception is added to the Response when the client application cancels an operation and uses the default value.

BackendException

That’s given on the Response when an API call to the backend return a specific error message. It contains title, details and httpStatusCode.

BlueIdAuthorizationException

That’s given on the Response when a call to a blue-id device fails. It contains secureObjectId and errorCode. Error code is either BlueIdAuthorizationException.NO_ACCESS_TO_SECURE_OBJECT_ID or one of the values from de.baimos.blueid.sdk.api.response.AuthorizationStatus

GattException

That’s given on the Response when a GATT operation fails. It contains errorCode. Error code is one of the GattException.GATT_* values.