Skip to content

Commit 5c277c7

Browse files
committed
Handle client disconnection gracefully in Thor handler
Catch EOFError, IOError, Errno::ECONNRESET, and Errno::EPIPE at the outer handle loop so Async doesn't log scary unhandled exception traces when clients disconnect mid-session.
1 parent 6b148fe commit 5c277c7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • gem/terminalwire-rails/lib/terminalwire

gem/terminalwire-rails/lib/terminalwire/rails.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ def handle(adapter:, env:)
198198
end
199199
end
200200
end
201+
rescue EOFError, IOError, Errno::ECONNRESET, Errno::EPIPE => e
202+
logger.debug "ThorServer: Client disconnected (#{e.class})"
201203
end
202204
end
203205
end

0 commit comments

Comments
 (0)