Skip to content
Snippets Groups Projects
Commit dd6cc17b authored by Udo Eisenbarth's avatar Udo Eisenbarth :speech_balloon:
Browse files

Improve error msg for beam splitter

parent 454fb2a4
No related branches found
No related tags found
1 merge request!24Resolve "Analysis: Improve error messages"
......@@ -105,7 +105,7 @@ impl BeamSplitter {
s.scale_vertical(1.0 - self.ratio()).unwrap();
out1_2_spectrum = Some(s);
}
_ => return Err(OpossumError::Analysis("expected DataEnergy value".into())),
_ => return Err(OpossumError::Analysis("expected DataEnergy value at input port".into())),
}
}
if let Some(Some(in2)) = in2 {
......@@ -118,7 +118,7 @@ impl BeamSplitter {
s.scale_vertical(1.0 - self.ratio()).unwrap();
out2_2_spectrum = Some(s);
}
_ => return Err(OpossumError::Analysis("expected DataEnergy value".into())),
_ => return Err(OpossumError::Analysis("expected DataEnergy value at input port".into())),
}
}
let out1_spec = merge_spectra(out1_1_spectrum, out2_2_spectrum);
......
......@@ -355,7 +355,8 @@ impl NodeGroup {
let g_clone = self.g.0.clone();
let mut group_srcs = g_clone.externals(Direction::Incoming);
let mut light_result = LightResult::default();
let sorted = toposort(&g_clone, None).unwrap();
let sorted = toposort(&self.g.0, None)
.map_err(|_| OpossumError::Analysis("topological sort failed".into()))?;
for idx in sorted {
// Check if node is group src node
let incoming_edges = if group_srcs.any(|gs| gs == idx) {
......
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