Dart API Referencedart:ioOSError

OSError class

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

class OSError {
  /** Constant used to indicate that no OS error code is available. */
  static const int noErrorCode = -1;

  /** Creates an OSError object from a message and an errorCode. */
  const OSError([String this.message = "", int this.errorCode = noErrorCode]);

  /** Converts an OSError object to a string representation. */
  String toString() {
    throw UnsupportedOperationException('OSError.toString');
  }

  /**
    * Error message supplied by the operating system. null if no message is
    * associated with the error.
    */
  final String message;

  /**
    * 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;
}

Static Properties

const int noErrorCode #

Constant used to indicate that no OS error code is available.

static const int noErrorCode = -1;

Constructors

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

Creates an OSError object from a message and an errorCode.

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

Properties

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;

final String message #

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

final String message;

Methods

String toString() #

Converts an OSError object to a string representation.

String toString() {
  throw UnsupportedOperationException('OSError.toString');
}