Skip to content

Commit

Permalink
#714 prevent throwing another exception if the request fails eg conne…
Browse files Browse the repository at this point in the history
…ction reset (#715)

* prevent throwing another exception if the request fails eg connection reset

* prevent throwing another exception if the request fails eg connection reset
  • Loading branch information
davidvanlaatum authored and wing328 committed Aug 2, 2018
1 parent 07a5715 commit a258cf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ module {{moduleName}}
tempfile.write(chunk)
end
request.on_complete do |response|
tempfile.close
tempfile.close if tempfile
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore/ruby/lib/petstore/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def download_file(request)
tempfile.write(chunk)
end
request.on_complete do |response|
tempfile.close
tempfile.close if tempfile
@config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
"with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
"will be deleted automatically with GC. It's also recommended to delete the temp file "\
Expand Down

0 comments on commit a258cf3

Please sign in to comment.