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 | 155 | request_start = Time.now | 
| 156 | 156 | log_request(context, num_retries) | 
| 157 | 157 | resp = yield | 
| 158 | - context = context.dup_from_response(resp) | |
| 159 | 158 | log_response(context, request_start, resp.status, resp.body) | 
| 160 | 159 | |
| 161 | 160 | # We rescue all exceptions from a request so that we have an easy spot to | 
| 162 | 161 | # implement our retry logic across the board. We'll re-raise if it's a type | 
| 163 | 162 | # of exception that we didn't expect to handle. | 
| 164 | 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 | 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 | 166 | e.response[:status], e.response[:body]) | 
| 173 | 167 | else | 
| 174 | - log_response_error(error_context, request_start, e) | |
| 168 | + log_response_error(context, request_start, e) | |
| 175 | 169 | end | 
| 176 | 170 | |
| 177 | 171 | if self.class.should_retry?(e, num_retries) | ... | ... |