about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-04-24 11:07:40 +0000
committerEric Wong <e@80x24.org>2015-04-24 11:07:40 +0000
commit9e3217b0522315d2d115e53309f3563e9554ffc9 (patch)
treefcb3031993cebf408cbdc48edbcbd066faa592c2 /lib
parentd77a63a565caf99b842b434e9afb3f220a7c60ff (diff)
downloadyahns-9e3217b0522315d2d115e53309f3563e9554ffc9.tar.gz
Bad connections or dead upstreams cannot be solved looking at a
backtrace, so avoid polluting logs with them and making other
problems less visible.
Diffstat (limited to 'lib')
-rw-r--r--lib/yahns/proxy_pass.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/yahns/proxy_pass.rb b/lib/yahns/proxy_pass.rb
index e86e9c9..7083104 100644
--- a/lib/yahns/proxy_pass.rb
+++ b/lib/yahns/proxy_pass.rb
@@ -72,6 +72,9 @@ class Yahns::ProxyPass # :nodoc:
         send_req_buf(req)
       end
     rescue => e
+      # avoid polluting logs with a giant backtrace when the problem isn't
+      # fixable in code.
+      e.set_backtrace([]) if Errno::ECONNREFUSED === e
       c.proxy_err_response(502, self, e, nil)
     end