Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #62 from Elao/feature/handle_php_error_in_createma…
Browse files Browse the repository at this point in the history
…ilandsend

Handle php7 \Error in Notifier::createMailAndSend()
  • Loading branch information
benji07 authored Jan 23, 2017
2 parents b2eaa9e + 4eae36c commit 91777fe
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Listener/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function getErrorString($errorNo)
}

/**
* @param ErrorException $exception
* @param \Throwable $exception
* @param Request $request
* @param array $context
* @param Command $command
Expand All @@ -311,8 +311,19 @@ public function getErrorString($errorNo)
public function createMailAndSend($exception, Request $request = null, $context = null, Command $command = null, InputInterface $commandInput = null)
{
if (!$exception instanceof FlattenException) {
if ($exception instanceof \Error) {
$exception = new \ErrorException(
$exception->getMessage(),
$exception->getCode(),
E_ERROR,
$exception->getFile(),
$exception->getLine()
);
}

$exception = FlattenException::create($exception);
}

if ($this->repeatTimeout && $this->checkRepeat($exception)) {
return;
}
Expand Down

0 comments on commit 91777fe

Please sign in to comment.