Skip to content

Conversation

@crbelaus
Copy link
Contributor

@crbelaus crbelaus commented Nov 22, 2024

For non-error tuples Exception.normalize/3 returns the original payload, which may be anything. Some payloads such as tuples don't implement the String.Chars protocol. So calling to_string/1 will fail. In such cases we fall back to inspect/1.

I made a few updates to the live.exs script to reproduce this problem. You can run elixir live.exs and click the button called «GenServer timeout». This will cause an error that should be recorded by the error tracker.

If you revert the changes that I made and try this same button you will se that the error payload cannot be converted to string and detaches the ErrorTracker telemetry handler.

Closes #109

For non-error tuples `Exception.normalize/3` returns the original
payload, which may be anything. Some payloads such as tuples don't
implement the `String.Chars` protocol. So cally `to_string/1` will fail.
In such cases we fall back to `inspect/1`.
@crbelaus crbelaus force-pushed the fix-genserver-timeouts branch from e119149 to e09ea86 Compare November 23, 2024 08:55
@crbelaus crbelaus marked this pull request as ready for review November 23, 2024 09:00
@crbelaus crbelaus requested a review from odarriba November 23, 2024 09:24
@crbelaus crbelaus self-assigned this Nov 23, 2024
Copy link
Contributor

@odarriba odarriba left a comment

Choose a reason for hiding this comment

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

🚢 🇮🇹

@crbelaus crbelaus merged commit 00f8271 into main Nov 26, 2024
3 checks passed
@crbelaus crbelaus deleted the fix-genserver-timeouts branch November 26, 2024 15:18
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.

ErrorTracker.Integrations.Phoenix detached after GenServer timeout

3 participants