diff options
author | Eric Wong <e@80x24.org> | 2015-10-03 11:35:29 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-10-03 11:35:29 +0000 |
commit | 7fed5c86ac223359466a88c7ca78316c994e646d (patch) | |
tree | cebbc476dddc8f979143b409caf7a1cc6eea82e9 /lib | |
parent | 584819a270c8d25f2bc2a40ed508844949bd2eee (diff) | |
download | yahns-7fed5c86ac223359466a88c7ca78316c994e646d.tar.gz |
Clients may disconnect on us while we're writing the response here, so we should shut the backtrace up to avoid polluting logs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/proxy_pass.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb index 89c6ef8..9512318 100644 --- a/lib/yahns/proxy_pass.rb +++ b/lib/yahns/proxy_pass.rb @@ -74,7 +74,10 @@ class Yahns::ProxyPass # :nodoc: rescue => e # avoid polluting logs with a giant backtrace when the problem isn't # fixable in code. - e.set_backtrace([]) if Errno::ECONNREFUSED === e + case e + when Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EPIPE + e.set_backtrace([]) + end c.proxy_err_response(502, self, e, nil) end |