summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-09-24 12:12:21 +0200
committerAzul <azul@riseup.net>2016-09-24 12:12:21 +0200
commitbde67131c2382883f7957fa06d85b471a18c09d4 (patch)
treefbda97cba08b4b2a35e92bc8d60cf34e7bf00e73 /lib
parent5a93f2d29c96e649440101f2d1ca28247631b59e (diff)
log HTTP::ConnectionErrors, respond with json body
Diffstat (limited to 'lib')
-rw-r--r--lib/nickserver/dispatcher.rb8
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