Skip to content

Add stack support#8

Merged
estesp merged 3 commits intocontainerd:mainfrom
dmcgowan:add-stack-support
Jun 21, 2024
Merged

Add stack support#8
estesp merged 3 commits intocontainerd:mainfrom
dmcgowan:add-stack-support

Conversation

@dmcgowan
Copy link
Member

Adds a new stack package which provides a stack error type. This is based off the stack from the archived pkg/errors package and buildkit's util/stack.

Differences...

  • Directly serializable and registered with typeurl. Does not rely on protobuf generation or registration. The additional control over the marshal/unmarshal allows an efficient and single error object to be used.
  • Does not wrap errors, instead relies on latest support in Go for multi-errors with the Unwrap() []error interface. This allows stacks to ride next to errors without changing their error structure. Introduced a "collapsible" interface to avoid outputting the stack errors unless the %+v option is given.
  • Simple helper interface using contexts with no global map
  • Uses runtime.CallerFrames to account for inlined functions instead of the "discourage" runtime.FuncForPC. See https://pkg.go.dev/runtime#Callers

dmcgowan added 2 commits June 19, 2024 00:06
Signed-off-by: Derek McGowan <[email protected]>
Signed-off-by: Derek McGowan <[email protected]>
@dmcgowan dmcgowan force-pushed the add-stack-support branch from fab7827 to 05e7f12 Compare June 20, 2024 04:42
@dmcgowan dmcgowan force-pushed the add-stack-support branch from 05e7f12 to f96dfda Compare June 20, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants