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).

HealthConnectQuotaExceededException​

📜 The Health Connect rate limited request quota has been exceeded, this will happen if you use the functions of RookSyncManager too many times.

🔧 Wait for a moment before syncing data again, the quota will be partially restored as the time passes so the longer you wait the more quota will be restored, we recommend waiting from 15 to 90 minutes.

HealthKitNotInstalledException​

📜 Health Connect is not installed.

🔧 Prompt the user to install Health Connect.

HealthKitNotSupportedException​

📜 The requested operation could not be completed because the current device is not supported by Health Connect.

🔧 Don't use Health Connect operations, follow the instruction in Availability documentation to easily identify incompatible devices.

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 HCRookConfigurationManager.

🔧 Provide the required RookConfiguration instance. More information here.

MissingPermissionsException​

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

🔧 Go to the Health Connect 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.

🔧 Verify that your app has the necessary read permissions.

🔧 Open the app that is currently writing to Health Connect; Fitbit, GoogleFit, etc. 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 HCRookConfigurationManager.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 (Health Connect).

UserNotInitializedException​

📜 The User was not initialized or failed to initialize.

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