Skip to content

6.11.0

Compare
Choose a tag to compare
@misha-rollun misha-rollun released this 30 Oct 20:47
· 30 commits to master since this release

Catch PHP errors and log it in Process and ProcessByName interrupters.

set_error_handler(function (int $errno, string $errstr, string $errfile, int $errline) use ($logger) : void {
    if (! (error_reporting() & $errno)) {
        // error_reporting does not include this error
        return;
    }

    $exception = new ErrorException($errstr, 0, $errno, $errfile, $errline);

    // Maybe in next releases we will throw this exceptions
    $logger->error('When execute process, catch PHP error. But not throwing it.', [
        'exception' => $exception
    ]);
});