Commit e3484f8f79019cb22b13b961876b91e951f535fc
1 parent
4a8bba96
remove dup check
Showing
1 changed file
with
2 additions
and
8 deletions
Show diff stats
lib/syspro/syspro_client.rb
@@ -155,23 +155,17 @@ module Syspro | @@ -155,23 +155,17 @@ module Syspro | ||
155 | request_start = Time.now | 155 | request_start = Time.now |
156 | log_request(context, num_retries) | 156 | log_request(context, num_retries) |
157 | resp = yield | 157 | resp = yield |
158 | - context = context.dup_from_response(resp) | ||
159 | log_response(context, request_start, resp.status, resp.body) | 158 | log_response(context, request_start, resp.status, resp.body) |
160 | 159 | ||
161 | # We rescue all exceptions from a request so that we have an easy spot to | 160 | # We rescue all exceptions from a request so that we have an easy spot to |
162 | # implement our retry logic across the board. We'll re-raise if it's a type | 161 | # implement our retry logic across the board. We'll re-raise if it's a type |
163 | # of exception that we didn't expect to handle. | 162 | # of exception that we didn't expect to handle. |
164 | rescue StandardError => e | 163 | rescue StandardError => e |
165 | - # If we modify context we copy it into a new variable so as not to | ||
166 | - # taint the original on a retry. | ||
167 | - error_context = context | ||
168 | - | ||
169 | if e.respond_to?(:response) && e.response | 164 | if e.respond_to?(:response) && e.response |
170 | - error_context = context.dup_from_response(e.response) | ||
171 | - log_response(error_context, request_start, | 165 | + log_response(context, request_start, |
172 | e.response[:status], e.response[:body]) | 166 | e.response[:status], e.response[:body]) |
173 | else | 167 | else |
174 | - log_response_error(error_context, request_start, e) | 168 | + log_response_error(context, request_start, e) |
175 | end | 169 | end |
176 | 170 | ||
177 | if self.class.should_retry?(e, num_retries) | 171 | if self.class.should_retry?(e, num_retries) |