Skip to content
Snippets Groups Projects
Commit a9627a81 authored by Christoph Groth's avatar Christoph Groth
Browse files

improve error message when a lead is attached to non-existing sites

parent 279d84b8
No related branches found
No related tags found
No related merge requests found
...@@ -1130,7 +1130,14 @@ class Builder(object): ...@@ -1130,7 +1130,14 @@ class Builder(object):
msg = 'Problem finalizing lead {0}:'.format(lead_nr) msg = 'Problem finalizing lead {0}:'.format(lead_nr)
e.args = (' '.join((msg,) + e.args),) e.args = (' '.join((msg,) + e.args),)
raise raise
interface = [id_by_site[isite] for isite in lead.interface] try:
interface = [id_by_site[isite] for isite in lead.interface]
except KeyError, e:
t, v, tb = sys.exc_info()
msg = "Lead {0} is attached to a site that does not " \
"belong to the scattering region:\n {1}"
raise ValueError(msg.format(lead_nr, v))
lead_interfaces.append(np.array(interface)) lead_interfaces.append(np.array(interface))
#### Assemble and return result. #### Assemble and return result.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment