Skip to content

Custom exception handler in command #25769

Closed
@fancyweb

Description

@fancyweb
Q A
Bug report? no
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4

Hello, first of all excuse me if this is not a BC break or if my code is really bad but the exception / error handling is something I don't master at all.

So in one of my project command, I did this :

$this->getApplication()->setCatchExceptions(false);
$errorHandler = ErrorHandler::register(null, false);
$errorHandler->throwAt(E_ALL, true);
$errorHandler->setExceptionHandler(function () {
	// .... my code
});

to execute something whenever a Symfony command throws an exception or has any error.

In 3.3 and before, if this command throws an exception it goes in my custom exception handler. In 3.4 it doesn't.

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