errno 1.4.1 copy "errno: ^1.4.1" to clipboard
errno: ^1.4.1 copied to clipboard

Defines system error code constants for the OSs that the Dart platform is running on

example/example.dart

import 'dart:io';

import 'package:errno/errno.dart';

void main() {
  try {
    var lst = Directory("My Documents").listSync();
    print(lst);
  } on FileSystemException catch (exc) {
    if (exc.osError?.errorCode == WindowsErrors.pathNotFound) {
      print("The directory does not exist.");
    } else {
      rethrow;
    }
  }
}
3
likes
160
points
225
downloads

Documentation

API reference

Publisher

verified publisherrevercode.com

Weekly Downloads

Defines system error code constants for the OSs that the Dart platform is running on

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on errno