file_errors 1.1.0 copy "file_errors: ^1.1.0" to clipboard
file_errors: ^1.1.0 copied to clipboard

Cross-platform extensions that help determine the cause of a caught FileSystemException.

example/example.dart

import 'dart:io';

import 'package:file_errors/file_errors.dart';

void main() {
  try {
    print(File('filename.txt').readAsStringSync());
  } on FileSystemException catch (exc) {
    if (exc.isNoSuchFileOrDirectory) {
      print('File does not exist!');
    } else {
      print('Unknown error: $exc');
    }
  }
}
0
likes
120
pub points
0%
popularity

Publisher

verified publisherrevercode.com

Cross-platform extensions that help determine the cause of a caught FileSystemException.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

errno

More

Packages that depend on file_errors