Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[ErrorHandler] ThrowableUtils::getSeverity doesn't work with SilencedErrorContext #41745

Copy link
Copy link
Closed
@d1mond

Description

@d1mond
Issue body actions

Symfony version(s) affected: 4.4 - 6.0

Description
When we create new instance ErrorHandler with BufferingLogger and then attach logger via ErrorHandler ::setLoggers and BufferingLogger contains SilencedErrorContext - we are getting error Argument 1 passed to Symfony\Component\ErrorHandler\ThrowableUtils::getSeverity() must implement interface Throwable, instance of Symfony\Component\ErrorHandler\Exception\SilencedErrorContext given

How to reproduce
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Psr\Log\LoggerInterface;

$handler = new ErrorHandler(new BufferingLogger(), false);
ErrorHandler::register($handler);

@file ('non_existent_file');

$handler->setDefaultLogger(new LoggerInterface);

Possible Solution
class SilencedErrorContext extends \ErrorException

Additional context
Argument 1 passed to Symfony\Component\ErrorHandler\ThrowableUtils::getSeverity() must implement interface Throwable, instance of Symfony\Component\ErrorHandler\Exception\SilencedErrorContext given

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.