SystemCallError is the base class for all low-level platform-dependent errors.

The errors available on the current platform are subclasses of SystemCallError and are defined in the Errno module.

File.open("does/not/exist")

raises the exception:

Errno::ENOENT: No such file or directory - does/not/exist
Class Methods

Return true if the receiver is a generic SystemCallError, or if the error numbers self and other are the same.

If errno corresponds to a known system error code, constructs the appropriate Errno class for that error, otherwise constructs a generic SystemCallError object. The error number is subsequently available via the errno method.

If only numeric object is given, it is treated as an Integer errno, and msg is omitted, otherwise the first argument msg is used as the additional error message.

SystemCallError.new(Errno::EPIPE::Errno)
#=> #<Errno::EPIPE: Broken pipe>

SystemCallError.new("foo")
#=> #<SystemCallError: unknown error - foo>

SystemCallError.new("foo", Errno::EPIPE::Errno)
#=> #<Errno::EPIPE: Broken pipe - foo>

If func is not nil, it is appended to the message with “ @ ”.

SystemCallError.new("foo", Errno::EPIPE::Errno, "here")
#=> #<Errno::EPIPE: Broken pipe @ here - foo>

A subclass of SystemCallError can also be instantiated via the new method of the subclass. See Errno.

Instance Methods

Return this SystemCallError’s error number.