rfidScannerExceptionFromPlatform function

RfidScannerException rfidScannerExceptionFromPlatform(
  1. PlatformException e
)

Converts PlatformException from method channels into RfidScannerException.

Implementation

RfidScannerException rfidScannerExceptionFromPlatform(PlatformException e) {
  final code = e.code.isNotEmpty ? e.code : 'UNKNOWN';
  final message = e.message ?? e.details?.toString() ?? 'Unknown error';
  return RfidScannerException(code, message);
}