Skip to content

feat: add OopsError.Layers() to inspect individual error chain layers#110

Merged
samber merged 5 commits intomainfrom
feature/layers
Apr 9, 2026
Merged

feat: add OopsError.Layers() to inspect individual error chain layers#110
samber merged 5 commits intomainfrom
feature/layers

Conversation

@samber
Copy link
Copy Markdown
Owner

@samber samber commented Apr 9, 2026

Closes #34 & #82

Copilot AI review requested due to automatic review settings April 9, 2026 18:30
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.74%. Comparing base (3b4e15c) to head (4a7141f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
error.go 87.50% 2 Missing and 2 partials ⚠️
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     
Flag Coverage Δ
unittests 88.74% <87.50%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() []*OopsError to 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.

@samber samber merged commit 0372e7b into main Apr 9, 2026
14 of 16 checks passed
@samber samber deleted the feature/layers branch April 9, 2026 20:19
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.

Can you add LastPublic(), LastCode() API?

2 participants