Don't crash when material file can't be opened for sending to printer

It seems that due to the threaded nature, the limit to the number of open file handlers could be reached here. Or it could just be locked or something of course.

Fixes Sentry issue CURA-2V2.
This commit is contained in:
Ghostkeeper 2021-09-22 14:59:27 +02:00
parent 0626eccb92
commit 426e3064d2
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -133,6 +133,9 @@ class SendMaterialJob(Job):
except FileNotFoundError: except FileNotFoundError:
Logger.error("Unable to send material {material_id}, since it has been deleted in the meanwhile.".format(material_id = material_id)) Logger.error("Unable to send material {material_id}, since it has been deleted in the meanwhile.".format(material_id = material_id))
return return
except EnvironmentError as e:
Logger.error(f"Unable to send material {material_id}. We can't open that file for reading: {str(e)}")
return
# Add the material signature file if needed. # Add the material signature file if needed.
signature_file_path = "{}.sig".format(file_path) signature_file_path = "{}.sig".format(file_path)