#!/usr/bin/env php getMessage(); exit(1); } try { $handler = new \Magento\Framework\App\ErrorHandler(); set_error_handler([$handler, 'handler']); $application = new Magento\Framework\Console\Cli('Magento CLI'); $application->run(); } catch (\Throwable $e) { while ($e) { if ($e->getFile()) { echo sprintf("\nThere is an error in %s", $e->getFile()); if ($e->getLine()) { echo sprintf(" at line: %d", $e->getLine()); } echo "\n"; } echo $e->getMessage(); echo $e->getTraceAsString(); echo "\n\n"; $e = $e->getPrevious(); } exit(Magento\Framework\Console\Cli::RETURN_FAILURE); }