Health Connect error codes and exceptions
9 error codes · 6 Jetpack exception types · last fetched from Google’s reference on 2026-10-03
android.health.connect.HealthConnectException defines 9 error codes, values 1 to 9, all added at API level 34. Google likens 5 of them to an existing exception class. The Jetpack HealthConnectClient reference documents 6 exception types in its Throws tables — SecurityException, RemoteException, IOException, IllegalArgumentException, IllegalStateException and UnsupportedOperationException — and does not name HealthConnectException at all.
The iOS counterpart is every HealthKit error code. Release-by-release changes to the Jetpack library are tracked on Health Connect SDK releases, and an empty read with no error at all is worked through in Health Connect returns no data.
HealthConnectException constants (9)
By value, as printed under “Constant Value” on Google’s reference (the page's own footer says it was last updated 2026-08-03). Descriptions are Google’s, verbatim. “Similar to” is copied from Google’s sentence and is blank where Google draws no comparison.
| Value | Constant | Google’s description | Similar to | Added |
|---|---|---|---|---|
| 10x00000001 | ERROR_UNKNOWN | An unknown error occurred while processing the call. | API 34U Extensions 7 | |
| 20x00000002 | ERROR_INTERNAL | An internal error occurred which the caller cannot address.This error may be considered similar to IllegalStateException | IllegalStateException | API 34U Extensions 7 |
| 30x00000003 | ERROR_INVALID_ARGUMENT | The caller supplied invalid arguments to the call.This error may be considered similar to IllegalArgumentException. | IllegalArgumentException | API 34U Extensions 7 |
| 40x00000004 | ERROR_IO | An issue occurred reading or writing to storage. The call might succeed if repeated.This error may be considered similar to IOException. | IOException | API 34U Extensions 7 |
| 50x00000005 | ERROR_SECURITYFix guide | The caller doesn't have the correct permissions for this call.This error may be considered similar to SecurityException. | SecurityException | API 34U Extensions 7 |
| 60x00000006 | ERROR_REMOTE | An IPC related error occurred.This error may be considered similar to RemoteException. | RemoteException | API 34U Extensions 7 |
| 70x00000007 | ERROR_RATE_LIMIT_EXCEEDEDFix guide | The caller exhausted the allotted rate limit. | API 34U Extensions 7 | |
| 80x00000008 | ERROR_DATA_SYNC_IN_PROGRESS | Data sync is in progress. Data read and writes are blocked.Caller should try this api call again later. | API 34U Extensions 7 | |
| 90x00000009 | ERROR_UNSUPPORTED_OPERATION | This operation is currently not supported by the platform.Caller may try this api call again later. | API 34U Extensions 7 |
What HealthConnectClient documents (6)
Every exception named in a “Throws” table on the Jetpack HealthConnectClient reference, grouped by class, with each distinct wording Google uses and the methods it appears on. Ordered by how many methods document it. This is what the reference states, not a list of everything a call can raise at runtime.
| Exception | Google’s wording | Documented on |
|---|---|---|
| SecurityExceptionFix guide |
| 15 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, getChanges, getChangesToken, insertRecords, readRecord, readRecords, updateRecords, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord, createMedicalDataSource, deleteMedicalResources, upsertMedicalResources |
| RemoteExceptionandroid.os.RemoteException |
| 12 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, getChanges, getChangesToken, insertRecords, readRecords, HealthConnectClient.deleteRecords, readRecord, updateRecords, HealthConnectClient.readRecord |
| IOExceptionjava.io.IOException |
| 10 methods: aggregate, aggregateGroupByDuration, aggregateGroupByPeriod, deleteRecords, insertRecords, readRecord, readRecords, updateRecords, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord |
| IllegalArgumentException |
| 3 methods: deleteMedicalDataSourceWithData, readMedicalResources, upsertMedicalResources |
| IllegalStateException |
| 3 methods: getOrCreate, HealthConnectClient.deleteRecords, HealthConnectClient.readRecord |
| UnsupportedOperationException |
| 3 methods: getOrCreate, checkIfMatchmakingIsPossible, createMatchmakingIntent |
Questions
What does each Health Connect error code number mean?
HealthConnectException.getErrorCode() returns one of 9 constants. As Google's reference printed them on 2026-10-03: 1 is ERROR_UNKNOWN (“An unknown error occurred while processing the call.”); 2 is ERROR_INTERNAL (“An internal error occurred which the caller cannot address.”); 3 is ERROR_INVALID_ARGUMENT (“The caller supplied invalid arguments to the call.”); 4 is ERROR_IO (“An issue occurred reading or writing to storage. The call might succeed if repeated.”); 5 is ERROR_SECURITY (“The caller doesn't have the correct permissions for this call.”); 6 is ERROR_REMOTE (“An IPC related error occurred.”); 7 is ERROR_RATE_LIMIT_EXCEEDED (“The caller exhausted the allotted rate limit.”); 8 is ERROR_DATA_SYNC_IN_PROGRESS (“Data sync is in progress. Data read and writes are blocked.”); 9 is ERROR_UNSUPPORTED_OPERATION (“This operation is currently not supported by the platform.”).
Which Health Connect errors does Google say may succeed on a later attempt?
3 constants, going by Google's own wording: ERROR_IO — “The call might succeed if repeated.”; ERROR_DATA_SYNC_IN_PROGRESS — “Caller should try this api call again later.”; ERROR_UNSUPPORTED_OPERATION — “Caller may try this api call again later.” The reference says nothing about retrying the others, so treat a retry of those as your own decision, and bound it.
Does the Jetpack HealthConnectClient reference mention HealthConnectException?
No. In the 2026-10-03 read the HealthConnectClient reference page does not name HealthConnectException at all. Its Throws tables document 6 exception types instead: SecurityException, RemoteException, IOException, IllegalArgumentException, IllegalStateException and UnsupportedOperationException. HealthConnectException belongs to the android.health.connect platform API; the second table on this page lists what the Jetpack reference documents.
Which Health Connect error codes does Google compare to standard exceptions?
5 constants carry Google's sentence “This error may be considered similar to …”: ERROR_INTERNAL to IllegalStateException, ERROR_INVALID_ARGUMENT to IllegalArgumentException, ERROR_IO to IOException, ERROR_SECURITY to SecurityException, ERROR_REMOTE to RemoteException. The other 4 have no such comparison.
Which Android API level added HealthConnectException?
Google's reference prints “Added in API level 34” for the class, also available in U Extensions 7. All 9 ERROR_* constants were added at API level 34, so none of them is newer than the class.
Read on 2026-10-03 from Google’s HealthConnectException and HealthConnectClient references by scripts/fetch-error-codes.mjs. Compiled by AIFitnessAPI; Google’s documentation remains the authority. All platforms’ error codes are indexed at error codes.