Skip to content

fix(ohno): capture actual caller location instead of ohno internals#260

Merged
Vaiz merged 8 commits intomainfrom
u/vaiz/2026/02/13/ohno-loc
Feb 13, 2026
Merged

fix(ohno): capture actual caller location instead of ohno internals#260
Vaiz merged 8 commits intomainfrom
u/vaiz/2026/02/13/ohno-loc

Conversation

@Vaiz
Copy link
Contributor

@Vaiz Vaiz commented Feb 13, 2026

fixes the problem when ohno enrichment captures enrichable.rs instead of caller location

Error: client error (Connect)
caused by: No such host is known. (os error 11001)
> failed to send HTTP request, scheme: https, authority: www.some-uknown-host.com, path: /path/abc (at D:\.cargo\registry\src\aa\ohno-0.3.0\src\enrichable.rs:54)

@Vaiz Vaiz changed the title fix(ohno): capture actuall caller location instead of ohno internals fix(ohno): capture actual caller location instead of ohno internals Feb 13, 2026
@Vaiz Vaiz requested a review from Copilot February 13, 2026 12:25
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (7a31d26) to head (f76043c).
⚠️ Report is 1 commits behind head on main.

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.
📢 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
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

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 via Location::caller().
  • Add #[track_caller] to IntoAppError::{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.

@Vaiz Vaiz force-pushed the u/vaiz/2026/02/13/ohno-loc branch from cc8ed11 to d211241 Compare February 13, 2026 13:44
@Vaiz Vaiz enabled auto-merge (squash) February 13, 2026 14:37
@Vaiz Vaiz merged commit 06c289d into main Feb 13, 2026
27 checks passed
@Vaiz Vaiz deleted the u/vaiz/2026/02/13/ohno-loc branch February 13, 2026 14:42
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.

4 participants