ReaderErrorCode enum

Stable, enum-like error codes for the unified reader contract.

These codes are the wire-level identifiers that the Android and iOS native bridges will map their platform-specific errors onto. They are intentionally finite and stable: removing or renumbering a value is a breaking change.

New codes are added by appending to this enum; never reorder.

Inheritance
Available extensions

Values

unknown → const ReaderErrorCode

Catch-all when no other code fits. The native bridge should set a nativeCode on the ReaderError to preserve detail.

const ReaderErrorCode('unknown')
notInitialized → const ReaderErrorCode

initialize was not called, or was called with invalid config, before another operation.

const ReaderErrorCode('not_initialized')
alreadyInitialized → const ReaderErrorCode

initialize was called more than once without an intervening tear down.

const ReaderErrorCode('already_initialized')
bluetoothDisabled → const ReaderErrorCode

The host device has Bluetooth turned off.

const ReaderErrorCode('bluetooth_disabled')
bluetoothPermissionDenied → const ReaderErrorCode

The host OS denied a Bluetooth permission prompt (or the app never requested it).

const ReaderErrorCode('bluetooth_permission_denied')
locationPermissionDenied → const ReaderErrorCode

The host OS denied a location permission prompt. Android BLE scans historically require location permission.

const ReaderErrorCode('location_permission_denied')
discoveryFailed → const ReaderErrorCode

Reader discovery failed before any device was returned.

const ReaderErrorCode('discovery_failed')
connectionFailed → const ReaderErrorCode

A connection attempt to a specific reader failed.

const ReaderErrorCode('connection_failed')
notConnected → const ReaderErrorCode

Operation requires a connected reader and there is none.

const ReaderErrorCode('not_connected')
alreadyConnected → const ReaderErrorCode

connect was called while a reader was already connected.

const ReaderErrorCode('already_connected')
readerBusy → const ReaderErrorCode

The reader rejected an operation because it was busy with another.

const ReaderErrorCode('reader_busy')
transactionInProgress → const ReaderErrorCode

startTransaction was called while a transaction was already in progress.

const ReaderErrorCode('transaction_in_progress')
noTransactionInProgress → const ReaderErrorCode

cancelTransaction was called with no transaction in progress.

const ReaderErrorCode('no_transaction_in_progress')
cardReadFailed → const ReaderErrorCode

The card read failed (bad swipe, chip read error, NFC abort).

const ReaderErrorCode('card_read_failed')
cardRemoved → const ReaderErrorCode

The card was removed before the read completed.

const ReaderErrorCode('card_removed')
timeout → const ReaderErrorCode

An operation exceeded its allotted time.

const ReaderErrorCode('timeout')
userCancelled → const ReaderErrorCode

The end user (or POS) cancelled the operation.

const ReaderErrorCode('user_cancelled')
networkError → const ReaderErrorCode

A network error reached the SDK while talking to em-api.

const ReaderErrorCode('network_error')
gatewayError → const ReaderErrorCode

em-api or the upstream gateway returned an error. SDK does not invent approval results; this is reported as-is.

const ReaderErrorCode('gateway_error')
invalidRequest → const ReaderErrorCode

A request was malformed (e.g. missing currency).

const ReaderErrorCode('invalid_request')
invalidAmount → const ReaderErrorCode

Amount was zero, negative, or otherwise rejected by the contract.

const ReaderErrorCode('invalid_amount')
invalidCurrency → const ReaderErrorCode

Currency was not a valid ISO 4217 code or is not supported.

const ReaderErrorCode('invalid_currency')
unsupportedOperation → const ReaderErrorCode

The requested operation is not supported on this platform / reader.

const ReaderErrorCode('unsupported_operation')
platformError → const ReaderErrorCode

A platform-channel error surfaced from the native bridge.

const ReaderErrorCode('platform_error')
internalError → const ReaderErrorCode

An unexpected error inside the SDK itself.

const ReaderErrorCode('internal_error')

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
wire → String
Stable wire identifier used on the platform channel.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromWire(String? value) → ReaderErrorCode

Constants

values → const List<ReaderErrorCode>
A constant List of the values in this enum, in order of their declaration.