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
140
points
32
downloads

Publisher

verified publisherrevercode.com

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

errno

More

Packages that depend on file_errors