SystemError::ClassMethods - Crystal 1.11.2

# module SystemError::ClassMethods

##
Defined in:

system_error.cr

##
Instance Method Summary

- #from_errno(message : String, **opts)

  Builds an instance of the exception from the current system error value (`Errno.value`).

- #from_errno(message : String | Nil = nil, errno : Errno | Nil = nil, **opts)

  DEPRECATED Use `.from_os_error` instead

- #from_os_error(message : String | Nil, os_error : Errno | WinError | WasiError | Nil, **opts)

  Builds an instance of the exception from an os_error value.

- #from_winerror(message : String | Nil, **opts)

  Builds an instance of the exception from the current windows error value (`WinError.value`).

- #from_wsa_error(message : String | Nil = nil, **opts)

  Builds an instance of the exception from the current Windows Socket API error value (`WinError.wsa_value`).

##
Instance Method Detail

def from_errno(message : String, **opts) #

Builds an instance of the exception from the current system error value (`Errno.value`).

The system message corresponding to the OS error value amends the message. Additional keyword arguments are forwarded to the exception initializer `.new_from_os_error`.

def from_errno(message : String | Nil = nil, errno : Errno | Nil = nil, **opts) #

DEPRECATED Use `.from_os_error` instead

def from_os_error(message : String | Nil, os_error : Errno | WinError | WasiError | Nil, **opts) #

Builds an instance of the exception from an os_error value.

The system message corresponding to the OS error value amends the message. Additional keyword arguments are forwarded to the exception initializer `.new_from_os_error`.

def from_winerror(message : String | Nil, **opts) #

Builds an instance of the exception from the current windows error value (`WinError.value`).

The system message corresponding to the OS error value amends the message. Additional keyword arguments are forwarded to the exception initializer `.new_from_os_error`.

def from_wsa_error(message : String | Nil = nil, **opts) #

Builds an instance of the exception from the current Windows Socket API error value (`WinError.wsa_value`).

The system message corresponding to the OS error value amends the message. Additional keyword arguments are forwarded to the exception initializer.