Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122393 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 qa.php.net (Postfix) with ESMTPS id 0A1211ADA70 for ; Fri, 16 Feb 2024 02:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1708029789; bh=TT+Zkpr0yTKgL5vYLSRfMvv/QnkgoJwhqz2/+Oln4aU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Q8ue/MJoh1ynccqYUa+QNSq81ZLUDWABpDVtAzGnVKdzFnPYO/z17IDkMFljySDMm d9+/eEl5jhUPxbf+gAXWyCFVlyMJ/cgI0qmaZvZ7qnQ66gG41xXeOwqzK7kXjkleD4 GipApKcAl2KsiwWHYyR47tn9T/CGp2oPnIBhK1czw5JU2dms+Cs3tdV6B5vN53nthp xCsWboAzLf0AMkutB18O2qS3vM5unOMC+6Gol/DfVZJKxilsPtwFGscJkHe1hmaaSw QL/t+d5BGxgh4Sd5zPJ3WduuFgq408JtKWiO6hQ2Z9ZcUbRKkeG0S/ZAoZNWNqzPbc oUuXL1kSPL5pQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 01A5C180ED9 for ; Thu, 15 Feb 2024 12:43:08 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 15 Feb 2024 12:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1708029784; bh=08NQ2PAuOpaFWeV5Z0/6JSjJ/Yy4ssbeOMSotg8hFhI=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=JOfkbuqhAtkAyL+p2sP8v2paS5QSWhEa8tCn+XbKfVcyrR2BhsaTq222/Oqg/VWK/ Ef3gZswYx/Q6E3kq7dL1VCxDuo9jrmMdAF4NWXZ3WLA79bsskTxN1DcqwHyJ9y63KZ K0S2y0Aspd/lK+LKinsH8qZ9MWk0HfmDyi6XJthrEYxrniPeHEGHD53neTbIoDlQTB 5lZdqbVc+DKjuRJdosC/REXP1H2mdAXusuSzxWT20E6DYKU/p/EFKCgKOJ4VwtH3na AJSZS7X/7Cggp4U+/VeEYCLve9+h54gtgm35Y7m3Hk/1RbLEJr5GIp4nCEvK19WGhz uzBS7F5wIL0fg== Message-ID: Date: Thu, 15 Feb 2024 21:43:02 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] Re: [RFC] OOP API for cURL extension Content-Language: en-US To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 2/15/24 16:44, Sara Golemon wrote: > * Define the conditions under which exceptions will be thrown (and which > exceptions) - I'll add these to the RFC, but in short: > * CurlException - Never, it's an interface type to group the other > exceptions. Interface or base Exception? I would suggest base exception for consistency with \Random\RandomException and \DateException and because of the reasoning I gave in this PR: https://github.com/php/php-src/pull/9220 > * CurlHandleException - Whenever a CurlHandle::method() fails (in lieu of > returning false) > * CurlMultiException - Same, but for the CurlMultiHandle class. > * CurlShareException - Same, but for the CurlShareHandle class. You already said that you would clarify, but I'm not sure if I find the distinction between Handle/Multi/Share useful. An invalid option being passed to curl_setopt() and curl_multi_setopt() is an invalid option in both cases. No need to differentiate the exception type, because you know what function you called. In fact it should probably be a ValueError and not even something ext/curl-specific. Likewise a connection failure would be a connection failure, no matter if it is emitted by a handle or a multihandle: This could be a CurlConnectException (or possible a namespaced Curl\ConnectException). Best regards Tim Düsterhus