tryMap method
Пытается преобразовать error в Failure, если это ошибка файловой системы.
Определяет тип ошибки через PlatformExceptions и анализирует путь для выбора между FileFailure и StorageFailure.
Возвращает: Failure или null, если ошибка не относится к файловой системе.
Implementation
@override
Failure? tryMap(Object error, [StackTrace? stackTrace]) {
final details = PlatformExceptions.fileSystemDetails(error);
if (details == null) return null;
if (PlatformExceptions.isPathNotFoundException(error)) {
return _mapPathNotFound(details.path, details.message);
}
return _mapFileSystem(details.path, details.message);
}