@return mixed

@throws YoloException
@throws \Exception
769231
public function run()
    {
        for ($i = 1; $i <= $this->maxRetry; $i++) {
            try {
                return call_user_func_array($this->process, $this->args);
            } catch (\Exception $e) {
                if (in_array(get_class($e), $this->allowedExceptions)) {
                    throw $e;
                }
            }

            if ($i < $this->maxRetry) {
                sleep($this->timeout);
                $this->logger->warning(sprintf('[%s] Can\'t perform action, retrying [%s/%s]', $this->logInfos['callable'], $i, $this->maxRetry));
            } else {
                $this->logger->error(sprintf('[%s] %s retry has failed, aborting [%s/%s]', $this->logInfos['callable'], $i, $this->maxRetry));
                $retryException = new YoloException('', 0, $e);
                $retryException->setRetry($this->maxRetry);
                $retryException->setTimeout($this->timeout);
                throw $retryException;
            }
        }
    }
829706
protected function _process()
    {
        if (is_callable($this->_handler)) {
            return $this->_processDelegated();
        }
        $spec = $this->_actual;

        if (!$spec instanceof Specification || $spec->passed() !== null) {
            return $this;
        }

        $closure = function () use ($spec) {
            $spec->reset();
            $spec->process($result);
            $this->_logs = $spec->logs();
            return $this->_passed = $spec->passed();
        };

        try {
            $this->_spin($closure);
        } catch (TimeoutException $e) {
        }
        if ($exception = $spec->log()->exception()) {
            throw $exception;
        }

        $this->_passed = $spec->passed() && ($this->_passed === null ? true : $this->_passed);
        return $this;
    }
553481
public function toArray() {
        $exception = [
            'type'  => static::class,
            'error' => $this->getMessage(),
            'code'  => $this->getCode(),
            'line'  => $this->getLine(),
            'file'  => $this->getFile(),
            'trace' => $this->getTrace(),
            'inner' => null
        ];

        $prev  = $this->getPrevious();
        $inner = &$exception['inner'];
        while ($prev !== null) {

            if ($prev instanceof JitesoftException) {
                // If inner is a jitesoftexception, we can fetch the inner exception
                // as an array, and due to the fact that there is only one inner exception,
                // it will take care of the nesting in its own toArray method.
                $inner = $prev->toArray();
                break;
            }

            $inner = [
                'type'  => get_class($prev),
                'error' => $prev->getMessage(),
                'code'  => $prev->getCode(),
                'line'  => $prev->getLine(),
                'file'  => $prev->getFile(),
                'trace' => $prev->getTrace(),
                'inner' => ($prev->getPrevious() !== null ? [] : null)
            ];

            $inner = &$inner['inner'];
            $prev  = $prev->getPrevious();
        }

        return $exception;
    }
1172434
protected function getRequest()
    {
        $url = $this->buildUrl($this->getBody());

        $response = $this->client->get($url, [
            'auth'    => $this->getAuth(),
            'headers' => [
                'Accept' => 'application/json',
            ],
        ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API.');
        }

        return $response;
    }
547310
public function toArray()
    {
        $fn = 'toArray' . ucfirst($this->presentation);
        if (!method_exists($this, $fn)) {
            throw new \Exception('There is no method ' . $fn . '.');
        }
        return $this->$fn();
    }
696877
public function json()
    {

        if (!$this->isContentType('application/json')) {
            throw new Exception('Response is not JSON');
        }

        if (empty($this->_jsonAsObject)) {
            $this->_jsonAsObject = Utils::json_parse($this->text(), false);
        }

        return $this->_jsonAsObject;

    }
963908
protected function load()
    {
        if ($this->uid === null) {
            throw new Exception('Entity "'. CamelCase::to($this->table) . '" not initialized');
        }

        $statement = $this->adapter->getDriver()->query(
            sprintf(
                "SELECT t0.* FROM `{$this->table}` AS t0 WHERE t0.`%s` = %s",
                $this->primary,
                $this->adapter->getDriver()->quote($this->uid, $this->properties[$this->primary]['type'])
            )
        );

        $row = $statement->fetchAssoc();

        if (false === is_array($row)) {
            throw new Exception('Entity not found "' . CamelCase::to($this->table) . ' #' . $this->uid . '"');
        }

        return $this->fromArray($row);
    }
1328355
public function next()
    {
        if (!mb_strlen($this->input)) {
            return false;
        }

        foreach ($this->engine->getPatterns() as $pattern) {
            if ($token = $this->scan($pattern->regex, $pattern->type)) {
                if (in_array($pattern->type, $this->disallow)) {
                    throw new Exception($pattern->type . ' is disallowed.', 3);
                }

                return $token;
            }
        }

        throw new Exception('Unknow pattern found at: ' . mb_substr($this->input, 0, 100), 12);
    }
784177
public function exe()
    {

        if ($this->oosql_fromFlag) {
            $this->from();
        }
        if (null != $this->oosql_join) {
            $this->sql($this->oosql_join);
        }
        if (null != $this->oosql_where) {
            $this->sql($this->oosql_where);
        }
        if (null != $this->oosql_in) {
            $this->sql($this->oosql_in);
        }
        if (null != $this->oosql_between) {
            $this->sql($this->oosql_between);
        }
        if (null != $this->oosql_limit) {
            $this->sql(' ' . $this->oosql_limit);
        }
        if (null != $this->oosql_group) {
            $this->sql(' ' . $this->oosql_group);
        }
        if (null != $this->oosql_order) {
            $this->sql(' ' . $this->oosql_order);
        }


        if (count($this->oosql_conValues) !== 0) {

            $return = $this->prep($this->oosql_conValues);
            $this->oosql_conValues = array();
            if ($return === false) {
                $msg = 'Execution failed! ' . $this->sql();
                throw new \Exception($msg, 9811, null);
            }

        } else {

            $this->oosql_stmt = $this->query($this->sql());

        }

        if ($this->oosql_insert) {

            $identity = $this->getEntityObject()->identity();

            if ($identity !== false) {
                if ($this->oosql_driver == 'pgsql') {
                    $identity = $this->oosql_table . '_' . $identity . '_seq';
                }
                $lastID = $this->lastInsertId($identity);

                return $lastID;
            }

        }

        return $this->oosql_stmt;
    }
113345
public function getArray()
    {
        $config = @include $this->location;
        if (!is_array($config)) {
            throw new \Exception('Config not found');
        }

        $this->config = $config;

        return $config;
    }
902153
protected function postRequest()
    {
        $response = $this->client->post($this->buildUrl(),
            [
                'auth'    => $this->getAuth(),
                'json'    => $this->getBody(),
                'headers' => [
                    'Accept' => 'application/json',
                ],
            ]);

        if ($response->getStatusCode() != 201 && $response->getStatusCode() != 200) {
            throw new \Exception('Unable to request from API. HTTP Error: '.$response->getStatusCode());
        }

        return $response;
    }
1185214
public function actionCreate()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['create']);
        }
        try{
            $model = new Menu;

            if ($model->load(Yii::$app->request->post()) && $model->save()) {
                Helper::invalidate();
                return ["success"=> true];
            } else {
                return ["success"=> false];
            }
        }catch(Exception $e){
            throw new Exception($e);
        }

    }
783666
private function execute()
    {
        $data = curl_exec($this->ch);

        if ($data === false) {
            $this->close();

            throw new \Exception('Impossible to pass the result.');
        }

        $this->error = curl_error($this->ch);

        $this->errno = curl_errno($this->ch);

        $this->header = curl_getinfo($this->ch);

        $this->executed = true;

        $this->close();

        return $data;
    }
716254
public function read()
    {
        $result = '';
        $ht = $this->getHTaccessFilename();
        $fs = $this->getFilesystem();
        if (@$fs->isFile($ht)) {
            $result = @$fs->get($ht);
            if ($result === false) {
                throw new Exception("Failed to read from file $ht");
            }
        }

        return $result;
    }
432733
public function farray() {
		if(is_object($this->sth)) {
			$retval = $this->sth->fetchAll();
		}
		else {
			throw new Exception(__METHOD__ .": statement handle was not created");
		}
		
		return($retval);
	}
526703
protected function exceptionProcessor()
    {
        $frameworkProcessors = $this->builder->processors();
        $httpConfig = $this->builder->configuration()->httpConfig();

        return $frameworkProcessors->httpExceptionResponse(
            $httpConfig->slice('exceptionResponse')
        );
    }
61509
private function execute() {
        $curlResponse = curl_exec($this->curl);

        $error = $this->getError();
        if (!empty($error)) {
            return $this->curlException($error['error'], $error['error_no']);
        }

        return $curlResponse;
    }