Skip to main content

Extra: Known exceptions

rook-sdk returns custom exceptions wrapped in a Future object in each function when an issue is encountered. Below there is a list of all ROOK exceptions, their description/cause 📜 and how to handle them if encountered 🔧.

Rook Exceptions​

ConnectTimeoutException​

📜 An HTTP request waited too long and could not be completed. This can happen because an unavailable or unstable internet connection.

🔧 Check your connectivity and try again.

DateNotValidForEventsException​

📜 The provided DateTime is not in the allowed range to extract events.

🔧 Use a valid DateTime; between 29 days (inclusive) and today (inclusive).

DateNotValidForSummariesException​

📜 The provided DateTime is not in the allowed range to extract events.

🔧 Use a valid DateTime; between 29 days ago (inclusive) and today (inclusive).

HealthKitNotInstalledException​

📜 Apple Health is not installed.

🔧 Prompt the user to install Apple Health.

HttpRequestException​

📜 An HTTP request failed, this usually means an error in ROOK servers.

🔧 Check if you configured the SDK credentials correctly, if that is OK look for the message property and send a report to ROOK support.

MissingConfigurationException​

📜 A RookConfiguration instance was not provided to a RookConfigurationManager.

🔧 Provide the required RookConfiguration instance. More information here.

MissingPermissionsException​

📜 The requested operation requires Apple Health permissions which are not granted.

🔧 Go to the Apple Health permissions section in the documentation to check how you can request permissions.

RecordsNotFoundException​

📜 The SDK could not find any health data related with the provided data type.

🔧 Open the Apple Health app, check that that your app has the necessary read permissions and try to force a sync.

🔧 Open the app that is currently writing to Apple Health. Check that all write permissions are granted and try to force a sync (pull-to-refresh).

SDKNotAuthorizedException​

📜 The requested operation requires an authorization level that your clientUUID doesn't have.

🔧 Check if you configured the SDK credentials correctly, if that is OK send a report to ROOK support, some of the features of the SDK require a special level of authorization that are not included in the basic level.

SDKNotInitializedException​

📜 The SDK was not initialized or failed to initialize.

🔧 Call AHRookConfigurationManager.initRook() and wait for a successful result.

SessionExpiredException​

📜 The SDK session expired and could not be automatically recovered.

🔧 Re-initialize the SDK with a valid Client UUID and secret. Ensure that the secret and package name of your app are registered in the ROOK portal.

UnknownException​

📜 Unknown exceptions from the OS (Android) or the platform (Samsung Health).

UserNotInitializedException​

📜 The User was not initialized or failed to initialize.

🔧 Call AHRookConfigurationManager.updateUserID() and wait for a successful result.