Skip to content

Conversation

@danielcondemarin
Copy link
Contributor

@danielcondemarin danielcondemarin commented Dec 13, 2024

This feature allows decorating oops errors with arbitrary metadata which users can retrieve later for purposes such as logging.

  • Metadata can be attached to oops errors. (oops.WrapfWithMetadata)
  • Calling oops.CollectMetadata retrieves the aggregated metadata for the entire chain.

@danielcondemarin danielcondemarin force-pushed the danielcondemarin/oops-err-metadata branch from bf0b752 to 716946f Compare December 16, 2024 09:19
@danielcondemarin danielcondemarin changed the title (WIP) feat: add oops.WrapfWithMetadata feat: add oops.WrapfWithMetadata Dec 16, 2024
@danielcondemarin danielcondemarin marked this pull request as ready for review December 16, 2024 09:26
@danielcondemarin danielcondemarin requested a review from jsm December 16, 2024 09:26
@danielcondemarin danielcondemarin force-pushed the danielcondemarin/oops-err-metadata branch from cc40b29 to d8b91cf Compare December 17, 2024 08:47
@danielcondemarin danielcondemarin requested a review from jsm December 17, 2024 13:58
This feature allows decorating oops errors with arbitrary metadata which users can retrieve later for purposes such as logging.

- Metadata can be attached to oops errors. (`oops.WrapfWithMetadata`)
- Calling `oops.CollectMetadata` retrieves the aggregated metadata for the entire chain.
If CollectMetadata finds a duplicate key in the metadata, it returns the outer most key instead of inner most.
@danielcondemarin danielcondemarin force-pushed the danielcondemarin/oops-err-metadata branch from 79e37ee to dc682f8 Compare December 17, 2024 20:13
Improves documentation for CollectMetadata and WrapfWithMetadata
@danielcondemarin danielcondemarin force-pushed the danielcondemarin/oops-err-metadata branch from dc682f8 to b7dc60f Compare December 17, 2024 20:14
@danielcondemarin danielcondemarin merged commit 8ecafb6 into samsarahq:master Dec 17, 2024
1 check passed
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.

2 participants