-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Description
Description
Hey! There is a method def download_file(request), which should write a message to the log when request completes with tempfile path. But if request fails, there are no tempfile:
def download_file(request)
# ...
request.on_complete do |response|
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 "\
"explicitly with `tempfile.delete`"
end
endopenapi-generator version
latest master 94152c4
Steps to reproduce
- Generate Ruby (Typhoeus or Faraday, doesn't matter) client
- Make API, which returns error or which is unavailable
- Try to download file with generated client
Suggest a fix/enhancement
Write a log message if tempfile exists. I'll make PR in a moment
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels