fix(ohno): capture actual caller location instead of ohno internals#260
Merged
fix(ohno): capture actual caller location instead of ohno internals#260
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #260 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 140 140
Lines 8507 8523 +16
=======================================
+ Hits 8507 8523 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves ohno’s error enrichment location reporting so enrichment entries point to the user call site (the actual caller) rather than ohno internals, and updates tests to validate the updated display output.
Changes:
- Add
#[track_caller]to enrichment helper methods (enrich,enrich_with) to capture correct file/line viaLocation::caller(). - Add
#[track_caller]toIntoAppError::{into_app_err, into_app_err_with}implementations and adjust logic to preserve accurate caller locations. - Update integration tests to assert formatted output includes caller file (and in some cases exact file:line).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/ohno/src/enrichable.rs | Adds #[track_caller] to enrichment helpers so Location::caller() reports user call sites. |
| crates/ohno/src/app/into_app_err.rs | Adds #[track_caller] and refactors error-path handling to attach enrichment with correct caller location. |
| crates/ohno/src/lib.rs | Improves crate-level rustdoc lint expect with an explicit reason. |
| crates/ohno/tests/core.rs | Tightens assertions to validate formatted enrichment lines include caller file. |
| crates/ohno/tests/app/into_trait.rs | Updates tests to validate IntoAppError enrichment contains correct caller file/line. |
| crates/ohno/tests/app/enrich_err.rs | Updates enrichment-related tests to check caller file appears in formatted output. |
| crates/ohno/tests/app/base.rs | Updates clone/enrichment test to validate formatted output includes caller file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cc8ed11 to
d211241
Compare
martintmk
approved these changes
Feb 13, 2026
sandersaares
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes the problem when ohno enrichment captures
enrichable.rsinstead of caller location