forked from loafle/openapi-generator-original
* 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:
parent
07a5715b9f
commit
a258cf3fc6
@ -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 "\
|
||||||
|
@ -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 "\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user