GEN-186: Allow to send Report
via network while keeping the frame stack structure
#4693
Labels
area/libs > error-stack
Affects the `error-stack` crate (library)
area/libs
Relates to first-party libraries/crates/packages (area)
category/enhancement
New feature or request
lang/rust
Pull requests that update Rust code
Related Problem
Context:
databendlabs/databend#15741 (comment)
Proposed Solution
Goal:
Provide a solution to send the error collected by a node to another node, and keep propagate the error in the receiver node, and finally pretty print the error frames as if it's all happen in a single stack frame.
Possible solution:
A frame stack is consist of several information: context type, location, the source error. The only thing in these three that prevent deserialization is the opaque context type. We can advance the formatting procedure, the default debug hook for
Report
, to serialize the context/attachements into strings/appendix, while keeping the frame structure and the location. At the final fmt procedure, the formatter should be able to recognise this special struct in frame and flatten the frames when rendering.Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: