Skip to content

Conversation

@nathanl
Copy link
Contributor

@nathanl nathanl commented Nov 12, 2025

To improve error messages and facilitate debugging.

Whenever possible, have error messages that include a PID also include
the process label, name, or initial call.

call_reason =
if maybe_pid do
"Error happened when attempting to transfer to #{inspect(maybe_pid)} " <>
"Error happened when attempting to transfer to #{Util.inspect_pid(maybe_pid)} " <>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that Util.inspect_pid/1 was updated to fall back to inspect/1 where it's not actually a pid

Copy link
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

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

Hi @nathanl, I am a bit conflicting about these changes because the information you are attaching here, in the majority of the cases, is already available as the init function (or similarly named) in the process dictionary, so we are attaching redundant information.

@nathanl
Copy link
Contributor Author

nathanl commented Nov 12, 2025

Gotcha. If I roll back the set_label calls, are you happy with the Util.inspect_pid/1 calls?

@nathanl
Copy link
Contributor Author

nathanl commented Nov 12, 2025

@josevalim I rebased to just the Util.inspect_pid/1 changes

@josevalim
Copy link
Member

Yes, let's do the inspect_pid for sure. We can even read the initial_call on inspect_pid too (if there is no label).

@nathanl
Copy link
Contributor Author

nathanl commented Nov 12, 2025

Added that

@josevalim
Copy link
Member

Thank you, please fix the tests to be less specific and we should be good to go!

@nathanl nathanl force-pushed the more_label_usage branch 4 times, most recently from b49d1e9 to ddc855d Compare November 13, 2025 18:54
@nathanl
Copy link
Contributor Author

nathanl commented Nov 13, 2025

@josevalim see update

Whenever possible, have error messages that include a PID also include
the process label, name, or initial call.
@nathanl
Copy link
Contributor Author

nathanl commented Nov 14, 2025

Rebased on master and tests are green

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.

2 participants