Skip to content

GEN-186: Allow to send Report via network while keeping the frame stack structure #4693

@andylokandy

Description

@andylokandy

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

Metadata

Metadata

Assignees

Labels

area/dxImprovements or additions to DX or docsarea/libsRelates to first-party libraries/crates/packages (area)area/libs > error-stackAffects the `error-stack` crate (library)category/enhancementNew feature or requestlang/rustPull requests that update Rust codepriority/3 lowLower priority: nice-to-have

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions