#714 prevent throwing another exception if the request fails eg connection reset (#715)

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

* prevent throwing another exception if the request fails eg connection reset
This commit is contained in:
David van Laatum 2018-08-03 01:32:09 +09:30 committed by William Cheng
parent 07a5715b9f
commit a258cf3fc6
2 changed files with 2 additions and 2 deletions

View File

@ -238,7 +238,7 @@ module {{moduleName}}
tempfile.write(chunk) tempfile.write(chunk)
end end
request.on_complete do |response| 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 "\ @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 "\ "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 "\ "will be deleted automatically with GC. It's also recommended to delete the temp file "\

View File

@ -244,7 +244,7 @@ module Petstore
tempfile.write(chunk) tempfile.write(chunk)
end end
request.on_complete do |response| 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 "\ @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 "\ "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 "\ "will be deleted automatically with GC. It's also recommended to delete the temp file "\