Improve the handling of leaveBreadcrumb
's metadata
property when it cannot be serialized
#1164
Labels
released
This feature/bug fix has been released
Description
We had breadcrumbs that were not showing up in our error reports, which wasn't discovered until we randomly saw
in our logs.
The problem was a simple fix ... we were sending a value from an enumerated type, and adding a
description
, orrawValue
, orString(describing: value)
all would do the trick. This led to being a bit more robust in our solution and before sending the payload to bugsnag, we converted any non serializable values usingString(describing: value)
.Describe the solution you'd like
I would like it if we didn't have to pre-process the metadata that we sent to
leaveBreadcrumb
. Being a little smarter about how to serialize data would be a win, or even if the compiler told us that we needed to fix it on the calling end, would have been a win.Describe alternatives you've considered
I built out solutions to leverage the compiler and to just convert at runtime when there was an issue, and found that the runtime change was less disruptive overall.
Additional context
The text was updated successfully, but these errors were encountered: