sentry-go
sentry-go copied to clipboard
Unmarshalable data behaves poorly
I noticed the following in a few of our event logs:
Original event couldn't be marshalled. Succeeded by stripping the data that uses interface{} type. Please verify that the data you attach to the scope is serializable.
A couple of observations/suggestions (which I'm happy to implement in a PR if desired):
- It would be very helpful to include the original error message. I.e.
partialMarshallMessage := fmt.Sprintf("Original event couldn't be marshaled: %s. Succeeded by stripping the data " +
"that uses interface{} type. Please verify that the data you attach to the scope is serializable.", err)
- The message seems to indicate that only some data will be stripped, but it strips all
Extradata. It would not be difficult (although efficiency would suffer) to loop through each element ofExtra, and strip only those that don't marshal.
2 would be far less important if 1 were implemented, to make debugging simpler. But both might be ideal.
Thoughts?
Ugh, sorry for the extraneous closing of this. Applying the patch in #213 to our private repo unintentionally closed this.
Let's do "option 1" first. Thanks for sending PRs for the two variations. I took a chance to try to make the info message more concise and still mention specifically which fields got dropped in #258, replacing #214.
We can ship "option 2" later.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀