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

Method into_report

libs/error-stack/src/compat/anyhow.rs:10–33  ·  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<AnyhowError>> {
11 match self {
12 Ok(value) => Ok(value),
13 Err(anyhow) => {
14 #[cfg(feature = "std")]
15 let sources = anyhow
16 .chain()
17 .skip(1)
18 .map(ToString::to_string)
19 .collect::<alloc::vec::Vec<_>>();
20
21 #[cfg_attr(not(feature = "std"), expect(unused_mut))]
22 let mut report: Report<AnyhowError> =
23 Report::from_frame(Frame::from_anyhow(anyhow, alloc::boxed::Box::new([])));
24
25 #[cfg(feature = "std")]
26 for source in sources {
27 report = report.attach(source);
28 }
29
30 Err(report)
31 }
32 }
33 }
34}

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