@@ -243,7 +243,7 @@ def add_to_resumable_upload(self, file_id, content, total_size):
243243 """
244244 safe_id = self .safe_id (file_id )
245245 try :
246- file_content = self .get_file (RESUMABLE_DIR , safe_id )
246+ file_content = self .get_file (RESUMABLE_DIR , safe_id , False )
247247 except NotFound :
248248 file_content = b""
249249 file_content += content
@@ -292,12 +292,13 @@ def get_resumable_file_obj(self, file_id):
292292 except KeyError :
293293 raise NotFound
294294
295- def get_file (self , bucket_name , file_name ):
295+ def get_file (self , bucket_name , file_name , show_error = True ):
296296 """Get the raw data of a file within a bucket
297297
298298 Arguments:
299299 bucket_name {str} -- Name of the bucket
300300 file_name {str} -- File name
301+ show_error {bool} -- Show error if the file is missing
301302
302303 Raises:
303304 NotFound: Raised when the object doesn't exist
@@ -310,8 +311,9 @@ def get_file(self, bucket_name, file_name):
310311 bucket_dir = self ._fs .opendir (bucket_name )
311312 return bucket_dir .open (file_name , mode = "rb" ).read ()
312313 except (FileExpected , ResourceNotFound ) as e :
313- logger .error ("Resource not found:" )
314- logger .error (e )
314+ if show_error :
315+ logger .error ("Resource not found:" )
316+ logger .error (e )
315317 raise NotFound
316318
317319 def delete_resumable_file_obj (self , file_id ):
0 commit comments