mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Gracefully fail if the profile can't be set currently
Discovered during work on CURA-7283.
This commit is contained in:
parent
68ad38de28
commit
548c02772d
1 changed files with 8 additions and 4 deletions
|
|
@ -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
|
# 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
|
# that it doesn't lump key errors together for the crashlogs
|
||||||
|
try:
|
||||||
machine_node = container_tree.machines[definition_id]
|
machine_node = container_tree.machines[definition_id]
|
||||||
variant_node = machine_node.variants[variant_name]
|
variant_node = machine_node.variants[variant_name]
|
||||||
material_node = variant_node.materials[material_base_file]
|
material_node = variant_node.materials[material_base_file]
|
||||||
quality_node = material_node.qualities[quality_id]
|
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():
|
for intent_node in quality_node.intents.values():
|
||||||
if intent_node.intent_category == intent_category: # Found an intent with the correct category.
|
if intent_node.intent_category == intent_category: # Found an intent with the correct category.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue