mirror of
https://github.com/flarum/framework.git
synced 2024-11-27 11:03:37 +08:00
Error handling: Tweak Reporter interface
Because reporters are used for exceptions we were not able to handle, it makes sense to simply pass the exception, not the "handled error".
This commit is contained in:
parent
6c454b8279
commit
ad25307e68
|
@ -12,6 +12,7 @@
|
|||
namespace Flarum\Foundation\ErrorHandling;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Log caught exceptions to a PSR-3 logger instance.
|
||||
|
@ -28,8 +29,8 @@ class LogReporter implements Reporter
|
|||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function report(HandledError $error)
|
||||
public function report(Throwable $error)
|
||||
{
|
||||
$this->logger->error($error->getError());
|
||||
$this->logger->error($error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,15 @@
|
|||
|
||||
namespace Flarum\Foundation\ErrorHandling;
|
||||
|
||||
use Throwable;
|
||||
|
||||
interface Reporter
|
||||
{
|
||||
public function report(HandledError $error);
|
||||
/**
|
||||
* Report an error that Flarum was not able to handle to a backend.
|
||||
*
|
||||
* @param Throwable $error
|
||||
* @return void
|
||||
*/
|
||||
public function report(Throwable $error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user