8000 [Console] Exit status is 0 on PHP7 when there is a \Throwable exception · Issue #18484 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Console] Exit status is 0 on PHP7 when there is a \Throwable exception #18484
Closed
@acasademont

Description

@acasademont

Hi!

Pretty basic example

<?php
$a = null;
$a->getId();

This in PHP7 will throw an \Error, which implements the \Throwable interface. However, on https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Application.php#L118 we are only catching \Exception to set the status code to 1. As a result, those especial exceptions in the console end up with an 0 exit status code, when it should be 1 as with all other normal exceptions. Thanks! Can work on a PR if needed :)

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

      0