feat: add OopsError.Layers() to inspect individual error chain layers#110
feat: add OopsError.Layers() to inspect individual error chain layers#110
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
==========================================
- Coverage 88.80% 88.74% -0.06%
==========================================
Files 15 15
Lines 1125 1155 +30
==========================================
+ Hits 999 1025 +26
- Misses 101 103 +2
- Partials 25 27 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new OopsError.Layers() API intended to let callers enumerate the error chain’s OopsError wrapping layers for per-layer inspection (in response to Issue #34’s request for top-layer access).
Changes:
- Documented
err.Layers()in the README “Builder method / Getter” table. - Added
OopsError.Layers() []*OopsErrorto collect chain layers (outermost → innermost). - Added unit tests covering basic layering behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| README.md | Documents the new Layers() getter. |
| error.go | Implements OopsError.Layers() using existing chain traversal helper. |
| error_test.go | Adds TestLayers for single/multi-layer chains and skipping plain-root errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #34 & #82