about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/request.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/lib/request.rb b/app/lib/request.rb
index f2905c462..a08e402ec 100644
--- a/app/lib/request.rb
+++ b/app/lib/request.rb
@@ -52,13 +52,15 @@ class Request
     begin
       response = http_client.public_send(@verb, @url.to_s, @options.merge(headers: headers))
     rescue => e
-      raise e.class, "#{e.message} on #{@url}", e.backtrace
+      raise e.class, "#{e.message} on #{@url}", e.backtrace[0]
     end
 
     begin
       response = response.extend(ClientLimit)
       response.body_with_limit if http_client.persistent?
       yield response if block_given?
+    rescue => e
+      raise e.class, e.message, e.backtrace[0]
     ensure
       http_client.close unless http_client.persistent?
     end