Merge pull request #1671 from hansfbaier/master
give human readable error messages if a connector or pin is not available
This commit is contained in:
commit
cb9f01be9e
|
@ -167,7 +167,12 @@ class ConnectorManager:
|
||||||
raise ValueError(f"\"{identifier}\" {err}") from err
|
raise ValueError(f"\"{identifier}\" {err}") from err
|
||||||
if pn.isdigit():
|
if pn.isdigit():
|
||||||
pn = int(pn)
|
pn = int(pn)
|
||||||
|
assert conn in self.connector_table, f"No connector named '{conn}' is available"
|
||||||
|
conn_entry = self.connector_table[conn]
|
||||||
|
if isinstance(conn_entry, dict):
|
||||||
|
assert pn in conn_entry, f"There is no pin '{pn}' on connector '{conn}'"
|
||||||
|
else:
|
||||||
|
assert pn < len(conn_entry), f"There is no pin with number '{pn}' on connector '{conn}', maximum is {len(conn_entry)-1}"
|
||||||
conn_pn = self.connector_table[conn][pn]
|
conn_pn = self.connector_table[conn][pn]
|
||||||
if ":" in conn_pn:
|
if ":" in conn_pn:
|
||||||
conn_pn = self.resolve_identifiers([conn_pn])[0]
|
conn_pn = self.resolve_identifiers([conn_pn])[0]
|
||||||
|
|
Loading…
Reference in New Issue