private function setErrorData()
    {
        if (!isset($this->record['context']['error'])) {
            return;
        }

        $this->errorData = $this->record['context']['error'];

        // remove the error from the context so we can use it for for other things.
        unset($this->record['context']['error']);
    }