mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
Add more info in exceptions
This commit is contained in:
parent
8179e1ee90
commit
c841382bbd
3 changed files with 18 additions and 4 deletions
|
@ -85,7 +85,14 @@ class VariantManager:
|
||||||
if variant_definition not in self._machine_to_buildplate_dict_map:
|
if variant_definition not in self._machine_to_buildplate_dict_map:
|
||||||
self._machine_to_buildplate_dict_map[variant_definition] = OrderedDict()
|
self._machine_to_buildplate_dict_map[variant_definition] = OrderedDict()
|
||||||
|
|
||||||
|
try:
|
||||||
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])[0]
|
variant_container = self._container_registry.findContainers(type = "variant", id = variant_metadata["id"])[0]
|
||||||
|
except IndexError as e:
|
||||||
|
# It still needs to break, but we want to know what variant ID made it break.
|
||||||
|
msg = "Unable to find build plate variant with the id [%s]" % variant_metadata["id"]
|
||||||
|
Logger.logException("e", msg)
|
||||||
|
raise IndexError(msg)
|
||||||
|
|
||||||
buildplate_type = variant_container.getProperty("machine_buildplate_type", "value")
|
buildplate_type = variant_container.getProperty("machine_buildplate_type", "value")
|
||||||
if buildplate_type not in self._machine_to_buildplate_dict_map[variant_definition]:
|
if buildplate_type not in self._machine_to_buildplate_dict_map[variant_definition]:
|
||||||
self._machine_to_variant_dict_map[variant_definition][buildplate_type] = dict()
|
self._machine_to_variant_dict_map[variant_definition][buildplate_type] = dict()
|
||||||
|
|
|
@ -129,8 +129,9 @@ class CuraStackBuilder:
|
||||||
extruder_definition = registry.findDefinitionContainers(id = extruder_definition_id)[0]
|
extruder_definition = registry.findDefinitionContainers(id = extruder_definition_id)[0]
|
||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
# It still needs to break, but we want to know what extruder ID made it break.
|
# It still needs to break, but we want to know what extruder ID made it break.
|
||||||
Logger.log("e", "Unable to find extruder with the id %s", extruder_definition_id)
|
msg = "Unable to find extruder definition with the id [%s]" % extruder_definition_id
|
||||||
raise e
|
Logger.logException("e", msg)
|
||||||
|
raise IndexError(msg)
|
||||||
|
|
||||||
# get material container for extruders
|
# get material container for extruders
|
||||||
material_container = application.empty_material_container
|
material_container = application.empty_material_container
|
||||||
|
|
|
@ -381,7 +381,13 @@ class ExtruderManager(QObject):
|
||||||
elif extruder_stack_0.definition.getId() != expected_extruder_definition_0_id:
|
elif extruder_stack_0.definition.getId() != expected_extruder_definition_0_id:
|
||||||
Logger.log("e", "Single extruder printer [{printer}] expected extruder [{expected}], but got [{got}]. I'm making it [{expected}].".format(
|
Logger.log("e", "Single extruder printer [{printer}] expected extruder [{expected}], but got [{got}]. I'm making it [{expected}].".format(
|
||||||
printer = global_stack.getId(), expected = expected_extruder_definition_0_id, got = extruder_stack_0.definition.getId()))
|
printer = global_stack.getId(), expected = expected_extruder_definition_0_id, got = extruder_stack_0.definition.getId()))
|
||||||
|
try:
|
||||||
extruder_definition = container_registry.findDefinitionContainers(id = expected_extruder_definition_0_id)[0]
|
extruder_definition = container_registry.findDefinitionContainers(id = expected_extruder_definition_0_id)[0]
|
||||||
|
except IndexError as e:
|
||||||
|
# It still needs to break, but we want to know what extruder ID made it break.
|
||||||
|
msg = "Unable to find extruder definition with the id [%s]" % expected_extruder_definition_0_id
|
||||||
|
Logger.logException("e", msg)
|
||||||
|
raise IndexError(msg)
|
||||||
extruder_stack_0.definition = extruder_definition
|
extruder_stack_0.definition = extruder_definition
|
||||||
|
|
||||||
## Get all extruder values for a certain setting.
|
## Get all extruder values for a certain setting.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue