PlatformExceptions class abstract final

Кроссплатформенные проверки типов ошибок dart:io.

Типы dart:io (SocketException, FileSystemException и т.д.) не существуют на web, поэтому мапперы не могут обращаться к ним напрямую. Эти probes сохраняют семантику на VM/mobile/desktop и возвращают false/null на web, где такие ошибки невозможны.

Пример

if (PlatformExceptions.isSocketException(error)) {
  final message = PlatformExceptions.socketMessage(error);
  // обработка сетевой ошибки...
}

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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

fileSystemDetails(Object? error) → ({String message, String? path})?
Детали ошибки файловой системы: (path, message) или null.
httpMessage(Object? error) → String?
Сообщение HttpException или null, если error не является HttpException.
isFileSystemException(Object? error) → bool
Проверяет, является ли error экземпляром FileSystemException.
isHandshakeException(Object? error) → bool
Проверяет, является ли error экземпляром HandshakeException.
isHttpException(Object? error) → bool
Проверяет, является ли error экземпляром HttpException.
isPathNotFoundException(Object? error) → bool
Проверяет, является ли error экземпляром PathNotFoundException.
isSocketException(Object? error) → bool
Проверяет, является ли error экземпляром SocketException.
isTlsException(Object? error) → bool
Проверяет, является ли error экземпляром TlsException.
socketMessage(Object? error) → String?
Сообщение SocketException или null, если error не является SocketException.