public function hasError()
    {
        $error = $this->getError();
        if ($error instanceof ErrorList) {
            return $error->has();
        }
        if ($error instanceof Exception) {
            return true;
        }

        return (string) $error !== '';
    }