Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2020-03-06 15:40:28 +0300
committerGhostkeeper <rubend@tutanota.com>2020-03-06 15:40:28 +0300
commit548c02772da8277c9162e81f413658242d368933 (patch)
treec062ee636a2877796a077f93c55f839d1bb29b83
parent68ad38de28de319331d9c99710a16f2627610d09 (diff)
Gracefully fail if the profile can't be set currently
Discovered during work on CURA-7283.
-rwxr-xr-xcura/Settings/MachineManager.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py
index 6b1460b17b..c344f8176d 100755
--- a/cura/Settings/MachineManager.py
+++ b/cura/Settings/MachineManager.py
@@ -1523,10 +1523,14 @@ class MachineManager(QObject):
# Yes, we can find this in a single line of code. This makes it easier to read and it has the benefit
# that it doesn't lump key errors together for the crashlogs
- machine_node = container_tree.machines[definition_id]
- variant_node = machine_node.variants[variant_name]
- material_node = variant_node.materials[material_base_file]
- quality_node = material_node.qualities[quality_id]
+ try:
+ machine_node = container_tree.machines[definition_id]
+ variant_node = machine_node.variants[variant_name]
+ material_node = variant_node.materials[material_base_file]
+ quality_node = material_node.qualities[quality_id]
+ except KeyError as e:
+ Logger.error("Can't set the intent category '{category}' since the profile '{profile}' in the stack is not supported according to the container tree.".format(category = intent_category, profile = e))
+ continue
for intent_node in quality_node.intents.values():
if intent_node.intent_category == intent_category: # Found an intent with the correct category.