Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(serializer): catch Throwable to handle PHP 7+ Errors#664

Merged
Hectorhammett merged 1 commit into
googleapis:mainfrom
mmucklo:throwable
Apr 29, 2026
Merged

fix(serializer): catch Throwable to handle PHP 7+ Errors#664
Hectorhammett merged 1 commit into
googleapis:mainfrom
mmucklo:throwable

Conversation

@mmucklo
Copy link
Copy Markdown
Contributor

@mmucklo mmucklo commented Apr 12, 2026

PHP7+ introduced the following hierarchy: https://www.php.net/manual/en/language.errors.php7.php

There's a base Throwable class which both Error and Exception derive from.

When using the protobuf.so C extension, it's possible that an error message such as "Class zetasql.ErrorMessageModeForPayload hasn't been added to descriptor pool" can manifest as a TypeError or Error which don't derive from Exception and thus cause a fatal instead of being caught.

@mmucklo mmucklo requested a review from a team as a code owner April 12, 2026 23:17
Use Throwable since the error message is actually Error which shares the base Throwable class but is not an Exception in PHP 7+.
@mmucklo mmucklo changed the title Use Throwable since the error message is actually Error fix(serializer): catch Throwable to handle PHP 7+ Errors Apr 12, 2026
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding and fixing this issue!

@bshaffer bshaffer requested a review from Hectorhammett April 21, 2026 18:19
@Hectorhammett
Copy link
Copy Markdown
Contributor

Good catch! Pun intended!

@Hectorhammett Hectorhammett merged commit 250acdb into googleapis:main Apr 29, 2026
16 of 17 checks passed
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.

3 participants