Skip to main content
Each SDK has its own error type. This page lists what the released SDKs (Flutter 0.7.0, Kotlin 0.4.2, Swift 0.4.3) actually throw.

Flutter

SynheartWearError

PermissionDeniedError (a SynheartWearError with code PERMISSION_DENIED) is thrown when the user denies the platform permission request. DeviceUnavailableError (DEVICE_UNAVAILABLE) and NetworkError (NETWORK_ERROR) are defined but not thrown by 0.7.0.

Cloud providers

WhoopProvider, GarminProvider, FitbitProvider and OuraProvider throw a plain Exception with a descriptive message (for example when userId is missing or the Synheart Wear API returns an error), and StateError for misuse. Catch Exception around provider calls.

BLE heart-rate monitors

BleHrmProvider throws BleHrmError, whose code is a BleHrmErrorCode: permissionDenied, bluetoothOff, deviceNotFound, subscribeFailed or disconnected. Unknown native errors map to subscribeFailed. Errors on the onHeartRate stream use the same type. See BLE Heart Rate Monitor.

Garmin Health SDK (RTS)

GarminHealth throws GarminSDKError subclasses, each a SynheartWearError with a GARMIN_* code: GarminInitializationError, GarminLicenseError, GarminScanError, GarminPairingError, GarminConnectionError, GarminStreamingError, GarminSyncError, GarminDataError and GarminPlatformError.

Apple Health XML import

Failures throw the sealed AppleHealthXmlError: ZipReadFailed, XmlNotFound, ParseFailed, IngestFailed or ImportCancelled.

Kotlin

SDK calls throw SynheartWearException(message, cause, code):
  • any call before initialize() (“SDK not initialized”);
  • initialize() failures, wrapped;
  • getProvider() when the vendor isn’t enabled or cloudConfig is missing;
  • every GarminHealth data call in the Maven Central build, which doesn’t include the licensed Garmin binary.
BLE calls throw BleHrmException, whose errorCode is a BleHrmErrorCode (PERMISSION_DENIED, BLUETOOTH_OFF, DEVICE_NOT_FOUND, SUBSCRIBE_FAILED, DISCONNECTED).

Swift

SDK calls throw SynheartWearError: The Apple Health XML import throws AppleHealthXmlError: zipReadFailed, xmlNotFound, parseFailed(line:column:message:), ingestFailed or cancelled.

Retries

The SDKs don’t retry cloud requests or back off on rate limits; handle retries in your app. The only automatic retry is BLE reconnection after an unexpected disconnect (see BLE Heart Rate Monitor).

Logging policy

The SDK logs at info/warn and never logs:
  • Vendor OAuth tokens.
  • Personal device_ids in plain (debug builds may; production ones do not).
  • Raw HRV/RR sample bytes.
  • XML payloads beyond malformed-record line numbers.
WearMetrics snapshots are not logged. Hosts that need observability should collect them at the consumer layer.