Further isolate before_send to only error events to avoid issues like #2663
Further isolate before_send to only error events to avoid issues like #2663