Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69875 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43807 invoked from network); 26 Oct 2013 12:18:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Oct 2013 12:18:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:59859] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/71-32877-513BB625 for ; Sat, 26 Oct 2013 08:18:29 -0400 Received: by mail-wi0-f175.google.com with SMTP id hm4so2108024wib.14 for ; Sat, 26 Oct 2013 05:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=l+CR4b1mCwwmQG8iiub92EJPM3cXqYSlABAD7ZGUUwE=; b=XCNo8UM9eqLxSLTo8dEH3khOw57Oeia2NyzqAMsMR6XTPZh8IigzgG5Iwr3dSEY5Iu NOSCTH21kF+KCmCbpLRF802PaEZxsNwR2buMqOCAkYNr/JKq2fKEreiCl+pWAz7lk6av wBMD3KCN6xeLXkTBkA7caSMMBHr2wiEl501xznJALbbggdqi81bRoU6OIk5NQfP7LJCU ySuJ5KLKeNarCHKGFhffpwuUdhgtKT05Om7TGXUfVkzS3SYIk17I9+UzTwdrFnG2VRPD Olhhkth1udHTGzqfrkpaTvd1FdwcZQ8mVQ2I2l+tR9oa0iFCpQ0OiRI4ZD6g2COYkmD9 cruw== X-Received: by 10.180.187.41 with SMTP id fp9mr2194423wic.33.1382789906099; Sat, 26 Oct 2013 05:18:26 -0700 (PDT) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id fb4sm15569791wib.8.2013.10.26.05.18.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 26 Oct 2013 05:18:25 -0700 (PDT) Message-ID: <526BB309.4030106@gmail.com> Date: Sat, 26 Oct 2013 13:18:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: internals@lists.php.net References: <52699FB5.20300@garfieldtech.com> <526A6BCC.3060502@php.net> <526AC472.8060607@sugarcrm.com> <526AC950.7020605@php.net> In-Reply-To: <526AC950.7020605@php.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: rowan.collins@gmail.com (Rowan Collins) On 25/10/2013 20:41, Joe Watkins wrote: > If we really wanted to, we could fix all the code that throws the base > Exception, making them throw specialized types, as they should This seems a little contradictory when you're proposing an undifferentiated EngineException, where individual errors would need to be distinguished based on the message string. That's pretty much what throw Exception('Some message'); gives in userland. Besides which... > and include a compiler check that finds catch(Exception) blocks and > complains, it shouldn't really be valid I don't think "catch(Exception)" blocks exist as a partner to "throw Exception;" they exist to mark a boundary in code that you don't want any exceptions to cross, or where you want to log all exceptions in some bespoke way. They might be the last in a long string of catch() blocks attached to one try, like the default: label in a switch statement. They might also, as discussed wrt assertions/expectations, be in a unit testing framework. -- Rowan Collins [IMSoP]