Repository navigation
feat(error): expose causes to errors.Is and errors.As - #31
Conversation
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
PR SummaryMedium Risk Overview
Package docs describe the new behavior, and tests cover nested causes, sentinels inside causes, Reviewed by Cursor Bugbot for commit df1a3fd. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough
ChangesError cause traversal
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The cause-traversal change is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit follows errors down the chain Comment |
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e13188c. Configure here.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

WithCausewere invisible toerrors.Isanderrors.As, since only the error fromWithWrapwas reachable throughUnwrap. Callers had to walkCauses()by hand to detect a nested failure, which defeats the purpose of recording causes in the first place.Unwrap() errorsignature is kept so existing callers anderrors.Unwrapconsumers keep working. The multi-child traversal lives on the private causes type instead, which lets the standard library do the walking rather than hand-rollingIsandAs.