Skip to content

Commit 2120529

Browse files
Move code comment
1 parent 8e5923d commit 2120529

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/system_error.cr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ module SystemError
4141
macro included
4242
extend ::SystemError::ClassMethods
4343

44+
# The following are macros so we can get the `errno` or `winerror` _before_
45+
# evaluating `message` and `opts` that may change the `errno` or `winerror` value.
46+
4447
# Builds an instance of the exception from the current system error value (`Errno.value`).
4548
#
4649
# The system message corresponding to the OS error value amends the *message*.
4750
# Additional keyword arguments are forwarded to the exception initializer `.new_from_os_error`.
4851
macro from_errno(message, **opts)
49-
# This is a macro in order to retrieve `Errno.value` first before evaluating `message` and `opts`.
5052
%errno = ::Errno.value
5153
::\{{ @type }}.from_os_error(\{{ message }}, %errno, \{{ opts.double_splat }})
5254
end

0 commit comments

Comments
 (0)