src/Console/Application.php
public function runWithTry(array $argv)
    {
        try {
            return $this->run($argv);
        } catch (CommandArgumentNotEnoughException $e) {
            $this->logger->error($e->getMessage());
            $this->logger->writeln('Expected argument prototypes:');
            foreach ($e->getCommand()->getAllCommandPrototype() as $p) {
                $this->logger->writeln("\t" . $p);
            }
            $this->logger->newline();
        } catch (CommandNotFoundException $e) {
            $this->logger->error($e->getMessage() . ' available commands are: ' .
                implode(', ', $e->getCommand()->getVisibleCommandList())
            );
            $this->logger->newline();

            $this->logger->writeln('Please try the command below to see the details:');
            $this->logger->newline();
            $this->logger->writeln("\t" . $this->getProgramName() . ' help ');
            $this->logger->newline();
        } catch (BadMethodCallException $e) {
            $this->logger->error($e->getMessage());
            $this->logger->error('Seems like an application logic error, please contact the developer.');
        } catch (Exception $e) {
            ExceptionPrinter::dump($e, $this->getOption('debug'));
        }

        return false;
    }
public function runWithTry(array $argv)
    {
        try {
            return $this->run($argv);
        } catch (CommandArgumentNotEnoughException $e) {
            $this->logger->error($e->getMessage());
            $this->logger->writeln('Expected argument prototypes:');
            foreach ($e->getCommand()->getAllCommandPrototype() as $p) {
                $this->logger->writeln("\t" . $p);
            }
            $this->logger->newline();
        } catch (CommandNotFoundException $e) {
            $this->logger->error($e->getMessage() . ' available commands are: ' .
                implode(', ', $e->getCommand()->getVisibleCommandList())
            );
            $this->logger->newline();

            $this->logger->writeln('Please try the command below to see the details:');
            $this->logger->newline();
            $this->logger->writeln("\t" . $this->getProgramName() . ' help ');
            $this->logger->newline();
        } catch (BadMethodCallException $e) {
            $this->logger->error($e->getMessage());
            $this->logger->error('Seems like an application logic error, please contact the developer.');
        } catch (Exception $e) {
            ExceptionPrinter::dump($e, $this->getOption('debug'));
        }

        return false;
    }
public function runWithTry ( array $ argv ) { try { return $ this -> run ( $ argv ) ; } catch ( CommandArgumentNotEnoughException $ e ) { $ this -> logger -> error ( $ e -> getMessage ( ) ) ; $ this -> logger -> writeln ( 'Expected argument prototypes:' ) ; foreach ( $ e -> getCommand ( ) -> getAllCommandPrototype ( ) as $ p ) { $ this -> logger -> writeln ( "\t" . $ p ) ; } $ this -> logger -> newline ( ) ; } catch ( CommandNotFoundException $ e ) { $ this -> logger -> error ( $ e -> getMessage ( ) . ' available commands are: ' . implode ( ', ' , $ e -> getCommand ( ) -> getVisibleCommandList ( ) ) ) ; $ this -> logger -> newline ( ) ; $ this -> logger -> writeln ( 'Please try the command below to see the details:' ) ; $ this -> logger -> newline ( ) ; $ this -> logger -> writeln ( "\t" . $ this -> getProgramName ( ) . ' help ' ) ; $ this -> logger -> newline ( ) ; } catch ( BadMethodCallException $ e ) { $ this -> logger -> error ( $ e -> getMessage ( ) ) ; $ this -> logger -> error ( 'Seems like an application logic error, please contact the developer.' ) ; } catch ( Exception $ e ) { ExceptionPrinter :: dump ( $ e , $ this -> getOption ( 'debug' ) ) ; } return false ; }
Execute `run` method with a default try & catch block to catch the exception.

@param array $argv

@return bool return true for success, false for failure. the returned
state will be reflected to the exit code of the process.
Execute run method with a default try & catch block to catch the exception .