Skip to content

Commit

Permalink
Merge 4b9b424 into 4cd29bf
Browse files Browse the repository at this point in the history
  • Loading branch information
stephandesouza committed Apr 2, 2019
2 parents 4cd29bf + 4b9b424 commit 239d30c
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/Commands/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ public function handle()
array_walk($modules, [$this, 'moduleSeed']);
$this->info('All modules seeded.');
}
} catch (\Throwable $e) {
} catch (\Error $e) {
$e = new \ErrorException($e->getMessage(), $e->getCode(), 1, $e->getFile(), $e->getLine(), $e);
$this->reportException($e);

$this->renderException($this->getOutput(), $e);

return 1;
} catch (\Exception $e) {
$this->reportException($e);

$this->renderException($this->getOutput(), $e);
Expand Down Expand Up @@ -192,21 +199,21 @@ public function getSeederNames($name)
* Report the exception to the exception handler.
*
* @param \Symfony\Component\Console\Output\OutputInterface $output
* @param \Throwable $e
* @param \Exception $e
* @return void
*/
protected function renderException($output, \Throwable $e)
protected function renderException($output, \Exception $e)
{
$this->laravel[ExceptionHandler::class]->renderForConsole($output, $e);
}

/**
* Report the exception to the exception handler.
*
* @param \Throwable $e
* @param \Exception $e
* @return void
*/
protected function reportException(\Throwable $e)
protected function reportException(\Exception $e)
{
$this->laravel[ExceptionHandler::class]->report($e);
}
Expand Down

0 comments on commit 239d30c

Please sign in to comment.