Skip to content

PHP: Don't throw ExitStatus 0 #479

@adamziel

Description

@adamziel

As seen in https://github.com/WordPress/wordpress-playground/pull/451/files#diff-a063d4a01f49cda0eb3523f6cf5f33e7f7f033407effb7ed7d4c4dffb24fe84d, php may throw an error that indicates exit status 0. This is a bug, as 0 means everything executed successfully and no errors were encountered. Let's find the root cause and either prevent the error from being thrown at all, or silence it at the framework level.

	try {
		php.useHostFilesystem();
		await php.cli(phpArgs);
	} catch (resultOrError) {
		const success =
			resultOrError.name === 'ExitStatus' && resultOrError.status === 0;
		if (!success) {
			throw resultOrError;
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions