Get the actual exception
@return Bond\Pg\Exception\QueryException
761534
public function get()
    {

        $class = null;

        // decide the most accurate exception we've got for this state and throw that
        if( $this->state ) {

            for( $i = 5; $i > 0; $i-- ) {
               $exceptionQueue[] = sprintf(
                "State%s",
                substr( $this->state, 0, $i )
               );
            }

            while( !$class and $_class = array_shift( $exceptionQueue ) ) {
                $file = __DIR__ . "/Exception/States/{$_class}.php";
                if( file_exists($file) ) {
                    $class = $_class;
                }
            }

        }

        // decide on class
        if( !$class ) {
            $class = 'Bond\Pg\Exception\QueryException';
        } else {
            $class = 'Bond\Pg\Exception\States\\'. $class;
        }

        //die( $class );

        return new $class(
            $this->sqlError,
            $this->state,
            self::getStateMessage($this->state),
            $this->sql
        );

    }
408285
public function getSession()
    {
        try {
            $session = \PagSeguro\Services\Session::create(
                $this->getPagSeguroCredentials()
            );
            return $session->getResult();
        } catch (\Exception $exception) {
            throw $exception;
        }
    }
1206445
public function commit()
    {
        try {
            $prepared = Agl::app()->getDb()->getConnection()->prepare("
                INSERT INTO
                    `" . $this->getDbPrefix() . $this->_dbContainer . "`
                (" . $this->_getFields() . ")
                VALUES
                (" . $this->_getPreparedFields() . ")
            ");

            if (! $prepared->execute($this->_fields)) {
                $error = $prepared->errorInfo();
                throw new Exception("The insert query failed (table '" . $this->getDbPrefix() . $this->_dbContainer . "') with message '" . $error[2] . "'");
            }

            if (Agl::app()->isDebugMode()) {
                Agl::app()->getDb()->incrementCounter();
            }

            $this->_setId(Agl::app()->getDb()->getConnection()->lastInsertId());

            return $prepared->rowCount();
        } catch (Exception $e) {
            throw new Exception($e);
        }

        return true;
    }
1026656
public function getQuery()
    {
        $documentName = $this->documentName;

        if ($documentName == null) {
            throw new QueryException('documentName should not be null');
        }

        $documentLimitation = $this->createFilterQuery('id')->setQuery(sprintf('id:%s_*', $documentName));
        $this->addFilterQuery($documentLimitation);

        $this->setQuery('*:*');

        return parent::getQuery();
    }
773187
public function getQuery()
    {
        $idField = $this->documentKey;

        if ($idField == null) {
            throw new QueryException('id should not be null');
        }

        $this->setQuery(sprintf('id:%s', $idField));

        return parent::getQuery();
    }
874086
public function getConnection() {
        if (is_null($this->conn) || !($this->conn)) {
            $dsn = 'dblib:host=' . $this->host . ':1433;dbname=' . $this->db . ';charset=utf8';
            $this->conn = new \PDO($dsn, $this->user, $this->pass);

            if (is_bool($this->conn)) {
                throw new \Exception('unable to connect to db with provided credentials');
            }
        }

        return $this->conn;
    }
672650
public function tryAnException()
    {
        try {
            $iterator = $this->endpoint->listRecords('foobardoesnotexist');
            $iterator->current();
        } catch (\Phpoaipmh\Exception\OaipmhException $e) {
            throw $e;
        }
    }
405289
public static function get_exception_handler() {
        return function($ex) {
            $info = get_exception_info($ex);

            $logerrmsg = "enrol_paypal IPN exception handler: ".$info->message;
            if (debugging('', DEBUG_NORMAL)) {
                $logerrmsg .= ' Debug: '.$info->debuginfo."\n".format_backtrace($info->backtrace, true);
            }
            error_log($logerrmsg);

            if (http_response_code() == 200) {
                http_response_code(500);
            }

            exit(0);
        };
    }
1314778
public function executeQuery(): IResultSet {
        $temp = null;
        
        if (!$this->build()) {
            throw new \Exception('Error no se pudo construir la sentencia sql');
        }
        
        $temp = $this->conect->query($this->generate);
        $this->generate = "";
        
        if ($temp == null) {
            throw new \Exception('Error no se pudo encontrar nada en la base de datos');
        }
       
        return new ResultSetMYSQL($temp);
    }
216706
public function execute()
    {
        $request = $this->initGraphqlRequest();
        $response = $request->postRaw(
            $this->buildPayload()
        );
        if ($response->getCode() !== 200) {
            throw ExceptionBuilder::fromHttpRequestAndResponse($request, $response);
        }

        return ResultSetBuilder::fromHttpResponse($response);
    }
1050924
public function execute()
    {
        $stmt = $this->dbh->prepare($this->__toString());

        try {
            $success = $stmt->execute($this->getValues());
            if (!$success) {
                $info = $stmt->errorInfo();

                throw new Exception($info[2], $info[0]);
            }
        } catch (PDOException $e) {
            throw new Exception($e->getMessage(), $e->getCode(), $e);
        }

        return $stmt;
    }
1373477
protected function loadRelationship()
    {
        $field_parameters = $this->getFieldParameters();

        $query = $this->buildRelationshipQuery($field_parameters);

        if (! $query) {
            throw new Exception('Could not build query from field parameters');
        }

        if (method_exists($this, 'amendRelationshipQuery')) {
            $query = $this->amendRelationshipQuery($query);
        }

        return $this->getRelationshipArray($query, $field_parameters);
    }
419011
private function execute()
    {
        $query = $this->qb->getQuery();

        if (true === $this->configs['translation_query_hints']) {
            if (true === $this->doctrineExtensions) {
                $query->setHint(
                    \Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER,
                    'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'
                );

                $query->setHint(
                    \Gedmo\Translatable\TranslatableListener::HINT_TRANSLATABLE_LOCALE,
                    $this->locale
                );

                $query->setHint(
                    \Gedmo\Translatable\TranslatableListener::HINT_FALLBACK,
                    1
                );
            } else {
                throw new \Exception('execute(): "DoctrineExtensions" does not exist.');
            }
        }

        $query->setHydrationMode(Query::HYDRATE_OBJECT);

        return $query;
    }
776755
protected function createDetailFromException()
    {
        $e = $this->detail;

        if (!$this->detailIncludesStackTrace) {
            return $this->getExceptionMessage($e);
        }

        $message = $this->getExceptionMessage($e);
        $this->additionalDetails['trace'] = $e->getTrace();

        $previous = [];
        $e = $e->getPrevious();
        while ($e) {
            $previous[] = [
                'code'    => (int) $e->getCode(),
                'message' => $this->getExceptionMessage($e),
                'trace'   => $e->getTrace(),
            ];
            $e = $e->getPrevious();
        }
        if (count($previous)) {
            $this->additionalDetails['exception_stack'] = $previous;
        }

        return $message;
    }
391939
public function check()
	{
		// Check if the db connector has been set.
		if (!($this->db instanceof PgsqlDriver))
		{
			throw new \Exception('Database connection wrong type.');
		}

		// Check if the tables have been specified.
		if (empty($this->from))
		{
			throw new \Exception('ERROR: No Tables Specified');
		}

		return $this;
	}
333684
public function sqlQuery($queryString)
    {
        try {
            // execute query
            $query = $this->connection->prepare(
                $queryString,
                [\PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY]
            );
            $query->execute();

            return $query;
        } catch (\PDOException $e) {
            throw new \Exception($e->getMessage());
        }
    }
1203834
public function get()
    {
        $url = $this->buildUrl($this->url);

        try {
            $response = $this->makeRequest($url);

            return $this->prepareResponse($response);
        }
        // The client needs to know only one exception, no
        // matter what exception is thrown by Guzzle
         catch (TransferException $e) {
            throw new ConnectionException($e->getMessage());
        }
    }