diff options
Diffstat (limited to 'app/services/projects/lfs_pointers/lfs_download_service.rb')
-rw-r--r-- | app/services/projects/lfs_pointers/lfs_download_service.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/app/services/projects/lfs_pointers/lfs_download_service.rb b/app/services/projects/lfs_pointers/lfs_download_service.rb index 398f00a598d..a009f479d5d 100644 --- a/app/services/projects/lfs_pointers/lfs_download_service.rb +++ b/app/services/projects/lfs_pointers/lfs_download_service.rb @@ -75,17 +75,15 @@ module Projects create_tmp_storage_dir File.open(tmp_filename, 'wb') do |file| - begin - yield file - rescue StandardError => e - # If the lfs file is successfully downloaded it will be removed - # when it is added to the project's lfs files. - # Nevertheless if any excetion raises the file would remain - # in the file system. Here we ensure to remove it - File.unlink(file) if File.exist?(file) - - raise e - end + yield file + rescue StandardError => e + # If the lfs file is successfully downloaded it will be removed + # when it is added to the project's lfs files. + # Nevertheless if any excetion raises the file would remain + # in the file system. Here we ensure to remove it + File.unlink(file) if File.exist?(file) + + raise e end end |