elixir-error-tracker / error-tracker

🐛 An Elixir-based built-in error reporting and tracking solution
https://hex.pm/packages/error_tracker
Apache License 2.0
418 stars 18 forks source link

Safely convert payloads to strings #110

Closed crbelaus closed 3 days ago

crbelaus commented 1 week ago

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