protected function buildErrorData()
    {
        if (is_null($this->errorCode)) {
            return null;
        }

        $data = [
            'code' => $this->errorCode,
            'message' => $this->message ?: $this->resolveMessage()
        ];

        return array_merge($data, $this->data);
    }