BleShieldNativeException.fromError constructor

BleShieldNativeException.fromError(
  1. dynamic error
)

Implementation

factory BleShieldNativeException.fromError(dynamic error) {
  String message = error.toString();
  dynamic details = error;
  if (error is PlatformException) {
    message = error.message ?? error.details?.toString() ?? error.code;
    details = error.details;
  }
  return BleShieldNativeException(
    code: BleShieldNativeErrorParser.getCode(error),
    message: message,
    details: details,
  );
}