Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129719 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id EF3FB1A00BC for ; Mon, 29 Dec 2025 23:23:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1767050594; bh=mBQdcVR0Fke7XgVxFI3W0CvBpyITRy+nAXeqT3e2gfY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=h7DsZTFJGOm36G6xf1NESqpvi6oSXY8XjqFIiqdiiYuD2JraWE9PnI5GJglx12ZTZ HH5avgf30Wy4jsrGy8r/h3I3QvkncZc5wyVhrI5mc9k7a69DS524Vkbqj/m1kFqyef eSVFz5u64Am1c8NO04YsuYm83d7SzNmVHRQlted9b8o77OSvbd3RIFeyCcW5ENTbBL qnO8Mo5g4esFhHv3TT1VuyDLzAa3Akpy8qw1K3xLbJyx7gwXmTxXOL5MW1WiUulsFG h4CAr7HFGNso7OiDncH4zJ/RySptx2t9ju275deiLtMMNe0WdJFg2QBrMfLbx3DGLz /XoeXroJLQCvQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 153B0180077 for ; Mon, 29 Dec 2025 23:23:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from james.smtp.mailx.hosts.net.nz (james.smtp.mailx.hosts.net.nz [43.245.52.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 29 Dec 2025 23:23:10 +0000 (UTC) Received: from 122-57-27-239-adsl.sparkbb.co.nz ([122.57.27.239] helo=[192.168.1.67]) by james.smtp.mailx.hosts.net.nz with esmtpsa authed as varteg.nz (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim 4.96) (envelope-from ) id 1vaMZn-00D8OE-1A for internals@lists.php.net; Tue, 30 Dec 2025 12:22:59 +1300 Message-ID: <36066994-5b15-4b96-88db-47ab4bf92376@varteg.nz> Date: Tue, 30 Dec 2025 12:22:52 +1300 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Re: [RFC] Stream Error Handling Improvements To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Hosts-DKIM-Check: none From: weedpacket@varteg.nz (Morgan) 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.