Make early-boot errors (syntax, others) be more easy-to-read

This commit is contained in:
Brady Wetherington 2023-02-15 11:31:13 -08:00
parent a1b0eaf128
commit 3757c7e353
2 changed files with 4 additions and 3 deletions

View file

@ -41,7 +41,9 @@ class Handler extends ExceptionHandler
public function report(Throwable $exception)
{
if ($this->shouldReport($exception)) {
\Log::error($exception);
if (class_exists(\Log::class)) {
\Log::error($exception);
}
return parent::report($exception);
}
}

View file

@ -1,5 +1,4 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
@ -114,7 +113,7 @@ $config = [
'access_token' => env('ROLLBAR_TOKEN'),
'level' => env('ROLLBAR_LEVEL', 'error'),
'check_ignore' => function($isUncaught, $args, $payload) {
if (App::environment('production') && get_class($args) == Rollbar\ErrorWrapper::class && $args->errorLevel == E_WARNING ) {
if (App::environment('production') && is_object($args) && get_class($args) == Rollbar\ErrorWrapper::class && $args->errorLevel == E_WARNING ) {
\Log::info("IGNORING E_WARNING in production mode: ".$args->getMessage());
return true; // "TRUE - you should ignore it!"
}