Dart API Referencedart:ioOSError

OSError Class

An OSError object holds information about an error from the operating system.

Constructors

Code const OSError([String message = "", int errorCode = noErrorCode]) #

const OSError([String this.message = "", int this.errorCode = noErrorCode]);

Static Fields

Code final int noErrorCode #

static final int noErrorCode = -1;

Methods

Code String toString() #

String toString() {
  StringBuffer sb = new StringBuffer();
  sb.add("OS Error");
  if (!message.isEmpty()) {
    sb.add(": ");
    sb.add(message);
    if (errorCode != noErrorCode) {
      sb.add(", errno = ");
      sb.add(errorCode.toString());
    }
  } else if (errorCode != noErrorCode) {
    sb.add(": errno = ");
    sb.add(errorCode.toString());
  }
  return sb.toString();
}

Fields

Code final int errorCode #

Error code supplied by the operating system. Will have the value noErrorCode if there is no error code associated with the error.

final int errorCode;

Code final String message #

Error message supplied by the operating system. null if no message is associated with the error.

final String message;