Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect parent setting, handling exceptions #10017

Merged
merged 1 commit into from Jul 22, 2021
Merged

Respect parent setting, handling exceptions #10017

merged 1 commit into from Jul 22, 2021

Conversation

GeoSot
Copy link
Contributor

@GeoSot GeoSot commented Jul 22, 2021

I just fell in a case where I had the following code, that always have to return result or exception, and during some commands execution, I was leading to nothing.

    $application = new Application();
    $application->setAutoExit(false);
    $application->setCatchExceptions(false);
    $input = new StringInput($command);

        try {    
            $exitCode = $application->run($input, $this->getOutput());
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());
            $exitCode = 1;
        } finally {
            return $this->printResult($exitCode, $command);
        }

Debugging the code, it lead me to this error:

Composer could not find a composer.json file in /app/public
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Although, it wasn't possible to get it, as the code exits, ignoring the parent setting

@Seldaek Seldaek added this to the 2.1 milestone Jul 22, 2021
@Seldaek Seldaek added the Bug label Jul 22, 2021
@Seldaek Seldaek merged commit e07d2a7 into composer:master Jul 22, 2021
@Seldaek
Copy link
Member

Seldaek commented Jul 22, 2021

Thanks

@PhilETaylor
Copy link

This PR broke things :) see #10022 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants