Fix bugs from the the error handling additions.

This commit is contained in:
Tyler Ward 2020-09-20 01:57:33 +01:00
parent 0e929fe85a
commit 038938cc27
2 changed files with 9 additions and 7 deletions

View File

@ -116,6 +116,7 @@ class Connector:
if len(loop) != 2:
raise Exception('Loops must be between exactly two pins!')
if self.additional_components:
for additional_component in self.additional_components:
if 'type' not in additional_component:
raise Exception('Additional components must have a type specified')
@ -204,6 +205,7 @@ class Cable:
else:
raise Exception('lists of part data are only supported for bundles')
if self.additional_components:
for additional_component in self.additional_components:
if 'type' not in additional_component:
raise Exception('Additional components must have a type specified')

View File

@ -111,7 +111,7 @@ class Harness:
qty *= sum(1 for value in connector.visible_pins.values() if value is True)
else:
raise ValueError('invalid qty parameter {}'.format(extra["qty_multiplier"]))
rows.append(html_line_breaks(component_table_entry(extra.get["type"], qty, extra.get("unit", None), extra.get("pn", None), extra.get("manufacturer", None), extra.get("mpn", None))))
rows.append(html_line_breaks(component_table_entry(extra["type"], qty, extra.get("unit", None), extra.get("pn", None), extra.get("manufacturer", None), extra.get("mpn", None))))
rows.append([html_line_breaks(connector.notes)])
html.extend(nested_html_table(rows))