/** * @param Request $request */ public function run(Request $request) { try { $this->locator->getCommandForRequest($request)->execute(); } catch (CommandLocatorException $e) { if ($e->getCode() == CommandLocatorException::UnknownCommand) { $this->ouput->writeError(sprintf("Unknown command '%s'\n\n", $request->getCommand())); } else { $this->showError($e->getMessage()); } } catch (\Exception $e) { $this->showError($e->getMessage()); } catch (\Throwable $t) { $this->showError($t->getMessage()); } }
/** * @param Request $request */ public function run(Request $request) { try { $this->environment->ensureFitness(); $this->setupRuntime(); $this->locator->getCommandForRequest($request)->execute(); } catch (ExtensionsMissionException $e) { $this->ouput->writeError(sprintf("Vour environment is not ready to run phive due to the following reason(s):\n\n %s\n", join("\n ", $e->getMising()))); } catch (CommandLocatorException $e) { if ($e->getCode() == CommandLocatorException::UnknownCommand) { $this->ouput->writeError(sprintf("Unknown command '%s'\n\n", $request->getCommand())); } else { $this->showError($e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace()); } } catch (\Exception $e) { $this->showError($e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace()); } catch (\Throwable $t) { $this->showError($t->getMessage(), $t->getFile(), $t->getLine(), $t->getTrace()); } }