This module can be included in any Exception
subclass that is used to wrap some system error (Errno
or WinError
)
When included it provides a from_errno
method (and from_winerror
on Windows) to create exception instances with a description of the original error. It also adds an #os_error
property that contains the original system error.
For example:
class MyError < Exception include SystemError end MyError.from_errno("Something happened")
© 2012–2020 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.35.1/SystemError.html