Skip to content

Comments

Catch Throwable instead of Exception in CallCenter#667

Open
ranpafin wants to merge 1 commit intophpspec:masterfrom
ranpafin:fix/record-throwable-calls-595
Open

Catch Throwable instead of Exception in CallCenter#667
ranpafin wants to merge 1 commit intophpspec:masterfrom
ranpafin:fix/record-throwable-calls-595

Conversation

@ranpafin
Copy link
Contributor

When a promise throws a Throwable that is not an Exception (e.g. TypeError),
CallCenter does not catch it, so the call is never recorded.

This changes the catch block in CallCenter and the type hint in Call from
Exception to Throwable, aligning them with ThrowPromise which already
accepts Throwable.

Closes #595

…wn errors

When a promise throws a Throwable that is not an Exception (e.g. TypeError,
Error), the CallCenter catch block missed it, so the call was never recorded.
This aligns CallCenter and Call with ThrowPromise which already supports
Throwable.

Fixes phpspec#595
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.

When a mocked method throws a Throwable the call to the method is not recorded

1 participant