MCPcopy Create free account
hub / github.com/hashintel/hash / into_report

Method into_report

libs/error-stack/src/compat/eyre.rs:10–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

8
9 #[track_caller]
10 fn into_report(self) -> Result<T, Report<EyreReport>> {
11 match self {
12 Ok(value) => Ok(value),
13 Err(eyre) => {
14 let sources = eyre
15 .chain()
16 .skip(1)
17 .map(alloc::string::ToString::to_string)
18 .collect::<alloc::vec::Vec<_>>();
19
20 #[cfg_attr(not(feature = "std"), allow(unused_mut))]
21 let mut report: Report<EyreReport> =
22 Report::from_frame(Frame::from_eyre(eyre, Box::new([])));
23
24 for source in sources {
25 report = report.attach(source);
26 }
27
28 Err(report)
29 }
30 }
31 }
32}

Callers

nothing calls this directly

Calls 4

OkInterface · 0.85
ErrInterface · 0.85
mapMethod · 0.45
attachMethod · 0.45

Tested by

no test coverage detected