, , , . , .
Laravel Lumen Handler
, . , - .
Laravel report()
app/Exceptions/Handler.php, , . :
public function report(Exception $e)
{
if ($e instanceof CustomConsoleException) {
}
...
}
renderForConsole()
, . Handler
, app/Exceptions/Handler.php :
public function renderForConsole($output, Exception $e)
{
$output->writeln('Something broke!');
(new ConsoleApplication)->renderException($e, $output);
}
$output
Symfony\Component\Console\Output \OutputInterface
, .
, uncaught, , , - . reportException()
renderException()
app/Console/Kernel.php
.
- , , , , , . , , :
abstract class AbstractGetItems extends Command
{
...
final public function fire()
{
try {
$this->getItems();
} catch (Exception $e) {
}
}
abstract protected function getItems();
}
getItems()
, fire()
. . - getItems()
, :
class GetSpecificItems extends AbstractGetItems
{
...
protected function getItems()
{
}
}