diff options
author | Azul <azul@riseup.net> | 2016-09-24 12:12:21 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-09-24 12:12:21 +0200 |
commit | bde67131c2382883f7957fa06d85b471a18c09d4 (patch) | |
tree | fbda97cba08b4b2a35e92bc8d60cf34e7bf00e73 /lib/nickserver/dispatcher.rb | |
parent | 5a93f2d29c96e649440101f2d1ca28247631b59e (diff) |
log HTTP::ConnectionErrors, respond with json body
Diffstat (limited to 'lib/nickserver/dispatcher.rb')
-rw-r--r-- | lib/nickserver/dispatcher.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/nickserver/dispatcher.rb b/lib/nickserver/dispatcher.rb index 869f721..07571d5 100644 --- a/lib/nickserver/dispatcher.rb +++ b/lib/nickserver/dispatcher.rb @@ -62,9 +62,11 @@ module Nickserver end def proxy_error_response - exception = handler_chain.rescued_exceptions.first - if exception - Nickserver::Response.new(502, exception.to_s) + exc = handler_chain.rescued_exceptions.first + if exc + puts " Error: #{exc}" + Nickserver::Response.new 502, + %Q|{"error": "#{exc}"}| end end |