Add model to track and send errors

In here, you need to send the trace as well. (actually, what we need is the `events` of the trace)
Need to do it for pubsub as well.