Add immediate caller info to the Error constructor (probably default arg?) #724

Open
opened 2025-03-10 19:41:02 +00:00 by jade · 6 comments
Owner

We have been dealing with nasty problems on HEAD where we don't have exact info as to where the errors are coming from since multiple sites share the same message. Enough of this, let's do #[track_caller] equivalent things.

I don't recall the exact way, but you can get the info: it's probably best done by a defaulted argument that constructs a source location class that gets it statically.

We have been dealing with nasty problems on HEAD where we don't have exact info as to where the errors are coming from since multiple sites share the same message. Enough of this, let's do `#[track_caller]` equivalent things. I don't recall the exact way, but you can get the info: it's probably best done by a defaulted argument that constructs a source location class that gets it statically.
jade added this to the Error reporting project 2025-03-10 19:41:02 +00:00
Author
Owner
aha: https://en.cppreference.com/w/cpp/utility/source_location
Owner

our plan was to do both that and extend the caller info at every TRY_AWAIT that propagates an exception outward. it's not a complete stack reconstruction, but it's probably close enough?

our plan was to do both that *and* extend the caller info at every TRY_AWAIT that propagates an exception outward. it's not a complete stack reconstruction, but it's probably close enough?
Member

This issue was mentioned on Gerrit on the following CLs:

  • comment in cl/2947 ("libutil: trace unwinding through async tasks")
  • commit message in cl/2947 ("libutil: trace unwinding through async tasks")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2947", "number": 2947, "kind": "comment"}, {"backlink": "https://gerrit.lix.systems/c/lix/+/2947", "number": 2947, "kind": "commit message"}], "cl_meta": {"2947": {"change_title": "libutil: trace unwinding through async tasks"}}} --> This issue was mentioned on Gerrit on the following CLs: * comment in [cl/2947](https://gerrit.lix.systems/c/lix/+/2947) ("libutil: trace unwinding through async tasks") * commit message in [cl/2947](https://gerrit.lix.systems/c/lix/+/2947) ("libutil: trace unwinding through async tasks")
Author
Owner

This is probably sufficiently accomplished by cl/2947, but maybe there is some further stuff we could do.

This is probably sufficiently accomplished by cl/2947, but maybe there is some further stuff we could do.
jade closed this issue 2025-04-06 21:43:41 +00:00
Owner

not sure? we only track on awaits, and the actual caller of the error ctor isn't even in that trace

not sure? we only track on awaits, and the actual caller of the error ctor isn't even in that trace
jade reopened this issue 2025-04-06 23:02:20 +00:00
Author
Owner

ah okay, yes, we probably should yoink this still, in that case.

ah okay, yes, we probably should yoink this still, in that case.
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#724
No description provided.