You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Sylwester Lachiewicz (Jira)" <ji...@apache.org> on 2026/09/08 13:09:00 UTC

[jira] [Resolved] (THRIFT-1711) \TException with blank code and message

     [ https://issues.apache.org/jira/browse/THRIFT-1711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylwester Lachiewicz resolved THRIFT-1711.
------------------------------------------
    Resolution: Fixed

{{TException::__construct(string|array|null $p1 = null, int|array $p2 = 0)}} tolerates blank code/message and normalizes via {{$p1 ?? ''}} ([lib/php/lib/Exception/TException.php|https://github.com/apache/thrift/blob/master/lib/php/lib/Exception/TException.php] lines 52-64). Resolving as Fixed.

> \TException with blank code and message
> ---------------------------------------
>
>                 Key: THRIFT-1711
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1711
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>            Reporter: Till Klampaeckel
>            Priority: Major
>
> When a {{\TException}} is thrown, all kind of custom variables are assigned to the exception class in the {{__construct}}. However, the default {{code}} and {{message}} of the exception class are not populated.
> Is it possible to fix this? Currently this presents an edge-case in exception handling.
> Cross-referencing this issue on PHPUnit here:
> https://github.com/sebastianbergmann/phpunit/pull/679
> I could (maybe :-)) work on a patch – however I am not sure if a patch PHP userland (aka  {{Thrift.php}}) or if that code is generated and I would have to patch something else.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)