Skip to content

Commit

Permalink
Add timeout to timeout error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 26, 2024
1 parent fc3fe3b commit c13ad8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/async/scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def io_wait(io, events, timeout = nil)
elsif timeout = get_timeout(io)
# Otherwise, if we default to the io's timeout, we raise an exception:
timer = @timers.after(timeout) do
fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become ready!")
fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become ready!")
end
end

Expand All @@ -256,7 +256,7 @@ def io_read(io, buffer, length, offset = 0)

if timeout = get_timeout(io)
timer = @timers.after(timeout) do
fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become readable!")
fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become readable!")
end
end

Expand All @@ -271,7 +271,7 @@ def io_write(io, buffer, length, offset = 0)

if timeout = get_timeout(io)
timer = @timers.after(timeout) do
fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become writable!")
fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become writable!")
end
end

Expand Down

0 comments on commit c13ad8a

Please sign in to comment.