-
-
Save Papierkorb/8760197afbe7cb0e6773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def move_file_to_temporary_path(file_object, user) | |
temp_path = temporary_file_path(user.id) | |
logger.info "Storing file for #{user.id} at #{temp_path}" | |
FileUtils.mv file_object.path, temp_path | |
temp_path | |
rescue SystemCallError => err # Catch all Errno:: errors | |
logger.error "Failed to store file for #{user.id}: #{err.message}" | |
logger.error err.backtrace.join "\n" | |
raise InternalError, "Data storage error" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment