From 426e3064d2e913f70be9ada112201b89c1ba0aeb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 22 Sep 2021 14:59:27 +0200 Subject: [PATCH] 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. --- plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py b/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py index 96a2b78e8f..877eaebcb7 100644 --- a/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py +++ b/plugins/UM3NetworkPrinting/src/Network/SendMaterialJob.py @@ -133,6 +133,9 @@ class SendMaterialJob(Job): except FileNotFoundError: Logger.error("Unable to send material {material_id}, since it has been deleted in the meanwhile.".format(material_id = material_id)) 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. signature_file_path = "{}.sig".format(file_path)