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

outdated

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

errno #

Defines system error code constants for the OSs running the Dart platform.

With these numeric codes, the OSError.errorCode property usually specifies the problem that occurred.

OS Class
Android, Linux LinuxErrors
iOS, macOS DarwinErrors
Windows WindowsErrors

Example #

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
0
pub points
22%
popularity

Publisher

verified publisherrevercode.com

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

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on errno