public function getError()
    {
        $error = $this->getFullError();

        if (!$error) {
            return '';
        }

        if (\is_string($error)) {
            return $error;
        }

        $rootError = $error;
        if (isset($error['root_cause'][0])) {
            $rootError = $error['root_cause'][0];
        }

        $message = $rootError['reason'];
        if (isset($rootError['index'])) {
            $message .= ' [index: '.$rootError['index'].']';
        }

        if (isset($error['reason']) && $rootError['reason'] != $error['reason']) {
            $message .= ' [reason: '.$error['reason'].']';
        }

        return $message;
    }