Re: Re: [RFC] Stream Error Handling Improvements

From: Date: Mon, 29 Dec 2025 23:22:52 +0000
Subject: Re: Re: [RFC] Stream Error Handling Improvements
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-129719@lists.php.net to get a copy of this message
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.

« previous php.internals (#129719) next »