Re: Re: [RFC] Stream Error Handling Improvements
| From: | Jakub Zelenka | Date: | Wed, 25 Feb 2026 12:37:47 +0000 |
| Subject: | Re: Re: [RFC] Stream Error Handling Improvements | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130167@lists.php.net to get a copy of this message | ||
Hi,
On Tue, Dec 30, 2025 at 12:25 AM Morgan <weedpacket@varteg.nz> wrote:
> On 2025-12-30 07:52, Jakub Zelenka wrote:
> >
> > Hi, I just published version 2.0 which is a significant redesign
> > including:
> >
> > - Introducing ... StreamErrorCode
> > enums.... The
> > code is backed (int) because I need to keep the number to easily match
> > the category and simplify the mapping. I think that in this case a
> > backed enum is better.
> >
>
> Just spitballing here, but perhaps a StreamErrorCategory enum? The Code
> could have a method/property that matches it to the corresponding
> Category; categorising errors of different kinds can be done by
> branching on the Category, rather than (possibly multiple) is*Error()
> tests.
>
This is an interesting idea but it wouldn't work because some categories
are overlapping. So is*Error functions seem better fit here.
Kind regards,
Jakub