commander icon indicating copy to clipboard operation
commander copied to clipboard

Add option to ignore exception in route

Open 8ctopus opened this issue 1 year ago • 0 comments

Currently the code catches any route Exception and the script exits.

    public function execArgv(?array $argv = null)
    {
        try {
            $this->handleArgv($argv);
        } catch (NoRouteFoundException $e) {
...
        } catch (Exception $e) {
            fwrite(STDERR, 'Program Error: ' . $e->getMessage() . PHP_EOL);

            // stdlib.h: #define EXIT_FAILURE 1
            exit(1);
        }
    }

I would like handle the exception myself and prevent the script from exiting. Are you open to such a change? It could be a Boolean passed in the constructor for example.

8ctopus avatar Dec 24 '24 06:12 8ctopus