Adds a new failure before trying to send a network request if we cannot encode the request body. Defensively, we will try to re-encode the request body without our diagnostic data in case that is the source of the problem. If this also fails, we delete the invalid events.
This also moves the callback handler for failures to the expected callbackQueue.
TODO: add tests
Checklist
[X] Does your PR title have the correct title format?
Summary
Adds a new failure before trying to send a network request if we cannot encode the request body. Defensively, we will try to re-encode the request body without our diagnostic data in case that is the source of the problem. If this also fails, we delete the invalid events.
This also moves the callback handler for failures to the expected callbackQueue.
TODO: add tests
Checklist