Errors
com.sladeid.biometric.capture.errors. SladeIDError is the open base class (not sealed) extending Exception; each subtype carries a stable code. Operational failures are emitted on flows, never thrown across the API boundary — capture methods return null instead.
SladeIDError (base)
open class SladeIDError(
message: String,
val code: String = "UNKNOWN",
cause: Throwable? = null,
) : Exception(message, cause)Catch it last when handling session.errors / manager.readerErrors.
Subtypes
| Class | code | Meaning | Extra fields |
|---|---|---|---|
CaptureError | CAPTURE_ERROR | Hardware/vendor failure, capture timeout, init error | — |
QualityError | QUALITY_ERROR | Quality threshold not met | finger: Int?, score: Int? |
NetworkError | NETWORK_ERROR | Middleware unreachable, timeout, HTTP error | httpStatus: Int? |
EncryptionError | ENCRYPTION_ERROR | Envelope key exchange failed | — |
AuthError | AUTH_ERROR | Invalid token, insufficient permissions, or the credential gate rejected capture | — |
Handling pattern
session.errors.collect { e ->
when (e) {
is AuthError -> promptReauth()
is NetworkError -> retryLater(e.httpStatus)
is QualityError -> promptBetterPlacement(e.finger)
is CaptureError -> promptReplaceReader()
is EncryptionError -> logAndAlert(e)
else -> logUnknown(e) // SladeIDError base
}
}Not errors
match/search→matched = false— a normal biometric result.verifyEnrollment→positionVerified = false— a normal “try again”.- Reader not plugged in — an empty
readerslist, never areaderErrorsemission.
See Handle failure modes.