catch general Throwable for before test execution code by applyACS · Pull Request #6929 · Codeception/Codeception · GitHub
Skip to content

catch general Throwable for before test execution code - #6929

Merged
TavoNiievez merged 1 commit into
Codeception:mainfrom
applyACS:patch-catch-throwable
Jun 17, 2026
Merged

TavoNiievez merged 1 commit into
Codeception:mainfrom
applyACS:patch-catch-throwable

Conversation

@applyACS

Copy link
Copy Markdown
Contributor

We had an error in a seeder and this was not caught by codeception. No test was running but codeception return 0 so it looked like everything was fine.
This is a fix this that case.

@burned42

Copy link
Copy Markdown
Contributor

@applyACS

Copy link
Copy Markdown
Contributor Author

my error was: Call to a member function foo() on null
this was in one of the observers
maybe that help reproducing it

@burned42

Copy link
Copy Markdown
Contributor

I tried it with

$foo = null;
$foo->foo();

in the try block and got

PHP Fatal error: Uncaught Error: Call to a member function foo() on null

but still got exit code 255.

I don't think this is a blocker for this PR though.

@TavoNiievez

Copy link
Copy Markdown
Member

I'm okay with this change, but I'm not sure it's the only place where it should be made.

@applyACS

Copy link
Copy Markdown
Contributor Author

Not sure if it's the only place. It's the place I've had a problem with.
Is this going to be approved?

@W0rma

W0rma commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@TavoNiievez
TavoNiievez merged commit 63f85ce into Codeception:main Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants