Errors
A SealdHealthcareError signals a protocol fault, a trust failure or a state your application must handle. It is never a decision. Every SealdHealthcareError carries one code from the fixed list below. retryable says whether the same call may succeed later with no change on your side.
SealdHealthcareError
interface SealdHealthcareError extends Error { code: ErrorCode; retryable: boolean;}enum SealdHealthcareError: Error { case locked, noSession, signInRequired, revoked, releaseBelowFloor, contractRetired, unreachable, storageUnreachable, containerInvalid, trustFailed, fingerprintMismatch, journalRefused, canceled, enrollmentRejected, enrollmentLapsed, notFound, `protocol`
var retryable: Bool { get }}class SealdHealthcareException(val code: ErrorCode, val retryable: Boolean) : Exception()
enum class ErrorCode { LOCKED, NO_SESSION, SIGN_IN_REQUIRED, REVOKED, RELEASE_BELOW_FLOOR, CONTRACT_RETIRED, UNREACHABLE, STORAGE_UNREACHABLE, CONTAINER_INVALID, TRUST_FAILED, FINGERPRINT_MISMATCH, JOURNAL_REFUSED, CANCELED, ENROLLMENT_REJECTED, ENROLLMENT_LAPSED, NOT_FOUND, PROTOCOL,}Catching an error
try { await client.session.signIn();} catch (error) { const sealdHealthcareError = error as SealdHealthcareError; if (sealdHealthcareError.code === 'release-below-floor') tellToUpdate(); else if (sealdHealthcareError.retryable) scheduleRetry(); else throw error;}do { try await client.session.signIn()} catch let error as SealdHealthcareError { switch error { case .releaseBelowFloor: tellToUpdate() default: if error.retryable { scheduleRetry() } else { throw error } }}try { client.session.signIn()} catch (error: SealdHealthcareException) { when (error.code) { ErrorCode.RELEASE_BELOW_FLOOR -> tellToUpdate() else -> if (error.retryable) scheduleRetry() else throw error }}Every code
| Code | Swift | Kotlin | Retryable | Meaning | What to do |
|---|---|---|---|---|---|
locked | .locked | ErrorCode.LOCKED | No | The device key is locked. Unlock it first. | Ask for the person’s secret through the unlock adapter and retry. |
no-session | .noSession | ErrorCode.NO_SESSION | No | No session is open, or it ended. | Call session.signIn(). |
sign-in-required | .signInRequired | ErrorCode.SIGN_IN_REQUIRED | No | The tenant requires the identity provider on resume, or the token’s refresh was refused. | Call session.signIn() rather than resume(). |
revoked | .revoked | ErrorCode.REVOKED | No | The device certificate (card) of this device is no longer active. The SDK has already discarded its offline lease and locked the device key. | Show that the device is revoked. Enroll a new one. |
release-below-floor | .releaseBelowFloor | ErrorCode.RELEASE_BELOW_FLOOR | No | The application’s version is below what the tenant requires. | Tell the person to update through the application’s own channel. |
contract-retired | .contractRetired | ErrorCode.CONTRACT_RETIRED | No | The Seald Healthcare Cloud no longer serves the Cloud API version this SDK uses. | Ship a release built on a current SDK. |
unreachable | .unreachable | ErrorCode.UNREACHABLE | Yes | The Seald Healthcare Cloud cannot be reached. What the offline lease covers still opens. | Retry once reachable. The reachable event says when. |
storage-unreachable | .storageUnreachable | ErrorCode.STORAGE_UNREACHABLE | Yes | The customer’s storage did not answer or refused the request. | Retry the call. A persistent failure lies in the customer’s storage, not in Seald Healthcare. |
container-invalid | .containerInvalid | ErrorCode.CONTAINER_INVALID | No | The stored object is damaged, belongs to a different object or version, or its key does not open it. | Treat the object as unreadable. Do not retry with it. |
trust-failed | .trustFailed | ErrorCode.TRUST_FAILED | No | A card, an identity authority or a registration failed its check against the trust root built into the SDK, or names another tenant. | Stop the flow and show a trust error. Do not retry. |
fingerprint-mismatch | .fingerprintMismatch | ErrorCode.FINGERPRINT_MISMATCH | No | The tenant’s backup key registration names a key other than the one this SDK pinned. | Stop and tell an administrator. Do not proceed on this device. |
journal-refused | .journalRefused | ErrorCode.JOURNAL_REFUSED | No | The Seald Healthcare Cloud refused the record of what this device opened offline. It has already discarded its offline lease and locked the device key. | Show that the device waits on review. Nothing to retry locally. |
canceled | .canceled | ErrorCode.CANCELED | No | The person did not complete the unlock or the sign-in the operation needed. | Let the person try again when ready. |
enrollment-rejected | .enrollmentRejected | ErrorCode.ENROLLMENT_REJECTED | No | An approver rejected the enrollment request. | Show the rejection. The person starts a new request. |
enrollment-lapsed | .enrollmentLapsed | ErrorCode.ENROLLMENT_LAPSED | No | An enrollment request lapsed unanswered. | Show that it lapsed. The person starts a new request. |
not-found | .notFound | ErrorCode.NOT_FOUND | No | The SDK does not hold what the call names, such as a tenant, a draft or a request. | Refresh the view the id came from. Do not retry with the same id. |
protocol | .protocol | ErrorCode.PROTOCOL | Yes when rate-limited, no otherwise | The Seald Healthcare Cloud answered with its own fault: a malformed request, too many requests, or a state that changed and could not be retried. | Back off and retry when rate-limited. Otherwise, report it as a bug. |