Has Exception?

@return \Exception|false
772063
function hasException()
    {
        // Check exception from raw response
        // Server Response Status is 200 but Logical Error May Happen And Returned in Response Body
        if (! $this->exception ) {
            $res = $this->expected();
            if ($res instanceof DataEntity) {
                // Response Body Can parsed To Data Structure
                if ( $exception = $res->get('error') ) {
                    // TODO handle token revoke exceptions; OAuth Exceptions
                    $this->exception = new exTokenMismatch(
                        $res->get('error_description')
                        .' '
                        .$res->get('hint')

                        , 401
                    );
                }
            }
        } else if ($this->exception instanceof exHttpResponse) {
            // Determine Known Errors ...
            $expected = $this->expected();
            if ($expected && $err = $expected->get('error') ) {

                if ( is_string($err) )
                {
                    switch ($err) {
                        case 'access_denied':
                        case 'invalid_grant':
                            $description = $expected->get('error_description');
                            $this->exception = new exOAuthAccessDenied($description);
                            break;
                        case 'invalid_request':
                            $description = $expected->get('error_description');
                            $this->exception = new exInvalidRequest($description);
                            break;
                    }

                } elseif (isset($err['state']))
                {
                    switch (@$err['state']) {
                        case 'exUserNotFound':
                            $this->exception = new exUserNotFound($err['message'], (int)$err['code']);
                            break;
                        case 'exOAuthAccessDenied':
                            $this->exception = new exTokenMismatch($err['message'], (int)$err['code']);
                            break;
                        case 'exIdentifierExists':
                            $this->exception = new exIdentifierExists($err['message'], (int)$err['code']);
                            break;
                        case 'exPasswordNotMatch':
                            $this->exception = new exPasswordNotMatch($err['message'], (int)$err['code']);
                            break;
                        case 'exUnexpectedValue':
                            $this->exception = new exUnexpectedValue($err['message'], (int)$err['code']);
                            break;
                        case 'exMessageMalformed':
                            $this->exception = new exUnexpectedValue($err['message'], (int)$err['code']);
                            break;
                    }
                }
            }
        }


        return $this->exception;
    }
1246093
public boolean hasException() {
        return Optional.ofNullable(commandResult)
                        .map(result -> StringUtils.hasText(result.getException()))
                        .orElse(false);
    }
1252029
public function isSendError()
    {
        $message = $this->getOriginalMessageObject();
        $headers = $message->getHeaders();
        $isSendError = false;
        if (is_array($headers) && count($headers)) {
            foreach (array_keys($headers) as $key) {
                if (strstr($key, 'x-fail') !== false) {
                    $isSendError = true;
                    break;
                }
            }
        }

        return $isSendError;
    }
180833
public function has( $key )
	{
		if( empty( $key ) )																		//  no Key given
			throw new InvalidArgumentException( 'Key must not be empty.' );						//  throw Exception
		if( isset( $this->pairs[$key] ) )														//  Key is set on its own
			return TRUE;
		else																					//  Key has not been found
		{
			$key		.= $this->divider;														//  prepare Prefix Key to seach for
			foreach( $this->pairs as $pairKey => $pairValue )									//  iterate all stores Pairs
			{
				if( $pairKey[0] !== $key[0] )													//  precheck for Performance
					continue;																	//  skip Pair
				if( strpos( $pairKey, $key ) === 0 )											//  Prefix Key is found
					return TRUE;
			}
		}
		return FALSE;
	}
712051
public function withException(\Exception $exception)
    {
        assert(!is_null($exception), 'Exception must not be null');

        return $this->withDetail('error', $exception->getMessage());
    }
546032
private static function hasPDOException(\Exception $exception)
    {
        if ($exception instanceof \PDOException) {
            return true;
        }
        if ($exception->getPrevious() === null) {
            return false;
        }
        return self::hasPDOException($exception->getPrevious());
    }
1215175
protected function isActive(): bool
    {
        if ($this->currentErrorException !== null) {
            return true;
        }

        // ugly, but there is no get_error_handler()
        $currentErrorHandler = set_error_handler(function () {});
        restore_error_handler();

        return is_array($currentErrorHandler) && $currentErrorHandler[0] === $this;
    }
814484
protected function isGuzzleException(Exception $e)
    {
        return (    is_a($e, GuzzleException\BadResponseException::class)
                ||  is_a($e, GuzzleException\ClientException::class)
                ||  is_a($e, GuzzleException\ConnectException::class)
                ||  is_a($e, GuzzleException\RequestException::class)
                ||  is_a($e, GuzzleException\SeekException::class)
                ||  is_a($e, GuzzleException\ServerException::class)
                ||  is_a($e, GuzzleException\TooManyRedirectsException::class)
                ||  is_a($e, GuzzleException\TransferException::class)
        );
    }
365502
public function isExists()
    {
        clearstatcache(true,(string)$this->resource);
        return is_file((string)$this->resource);
    }
404414
public function isGoneAwayException(\Exception $exception)
    {
        $message = $exception->getMessage();

        foreach ($this->goneAwayExceptions as $goneAwayException) {
            if (stripos($message, $goneAwayException) !== false) {
                return true;
            }
        }

        return false;
    }
932834
public function check(): bool
  {
    if ( $this->current !== null ){
      // if $on_error is set to E_CONTINUE returns true
      if ( $this->on_error === self::E_CONTINUE ){
        return true;
      }
      // If any connection has an error with mode E_STOP_ALL
      if ( self::$has_error_all && ($this->on_error !== self::E_STOP_ALL) ){
        return false;
      }
      // If this connection has an error with mode E_STOP
      if ( $this->has_error && ($this->on_error !== self::E_STOP) ){
        return false;
      }
      return true;
    }
    return false;
  }
899779
public static function hasError() {
		$error        = json_last_error();
		$errorMessage = array_key_exists($error, self::$errors) ? self::$errors[$error] : "Unknown error ({$error})";
		return $errorMessage;
	}
364384
public function isValidClass()
    {
        $invalidClassList = array_unique(PageSlice::config()->get('default_slices_exceptions'));
        return !in_array($this->owner->getClassName(), $invalidClassList);
    }
1301791
public function hasTokens()
  {
    if (!is_writable(Remember::$tokensDir) || !is_dir(Remember::$tokensDir)) {
      $tokens = Remember::$tokensDir;
      return $this->exception("'$tokens' does not exist or is not writable by the web server");
    }
  }
1055734
public function isValid()
    {
        $value = $this->field->getValue();

        if (is_array($value) || is_object($value)) {
            throw new \Exception("This validator only works on scalar types!");
        }

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if the field contains a valid number value.
        if (!preg_match('/^-?\d+$/', $value)) {
            return false;
        }

        // check if the value is not to low.
        if ($this->min !== null) {
            if ($value < $this->min) {
                return false;
            }
        }

        // check if the value is not to high.
        if ($this->max !== null) {
            if ($value > $this->max) {
                return false;
            }
        }

        return true;
    }
1371386
protected function shouldExceptionBeLogged(Throwable $exception): bool
	{
		if($this->logger === null)
		{
			return false;
		}

		foreach($this->disableLoggingFor as $exceptionType)
		{
			if($exception instanceof $exceptionType)
			{
				return false;
			}
		}

		return true;
	}
661085
private function _tableExists() {

        // Try a select statement against the table
        // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.
        try {
            $result = mysqli_query($this->link,"SELECT 1 FROM $this->table_name LIMIT 1");
        } catch (\Exception $e) {
            // We got an exception == table not found
            return FALSE;
        }

        // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)
        return $result !== FALSE;
    }