PlatformOperationException.fromPlatformException constructor
PlatformOperationException.fromPlatformException(})
Creates a PlatformOperationException from a PlatformException.
Implementation
factory PlatformOperationException.fromPlatformException(
PlatformException e, {
required String operation,
String? userMessage,
String? devMessage,
bool isReportable = true,
Severity? severity,
}) {
final s = severity ?? _severityFromCode(e.code);
return PlatformOperationException(
operation: operation,
userMessage: userMessage ?? _userMessageFromCode(e.code),
devMessage: devMessage ?? (e.message ?? 'Unknown platform error.'),
code: e.code,
details: e.details,
cause: e,
severity: s,
isReportable: isReportable,
);
}