Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85749 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23188 invoked from network); 9 Apr 2015 10:34:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2015 10:34:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.217 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.217 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.217] ([81.169.146.217:26001] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/40-17490-A9556255 for ; Thu, 09 Apr 2015 06:34:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1428575638; l=4272; s=domk; d=kelunik.com; h=Content-Type:To:Subject:Date:From:In-Reply-To:References: MIME-Version; bh=Pve87IdIEJI4ceOHdwa5uoHqLKrFgAJdSInaMAykZD8=; b=eegwiEKfKLu2Fg1tXFIdZ8w8ZT5f4XzuNA8VLnFLaMY18A3el89TIdCuvFIJcYLekdN uzoJ8eIukpBczPqDBIrxPyxzlgm2mHCFOJnF/XXXOBy1LSkJIhX12YcwbTEL+ksMoxsf7 kvu2IOyMxcQcLspegFftL85zoLSLXA10xHs= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3U6 X-RZG-CLASS-ID: mo00 Received: from mail-wg0-f46.google.com ([74.125.82.46]) by smtp.strato.de (RZmta 37.5 AUTH) with ESMTPSA id e05077r39AXwQg4 (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve sect571r1 with 571 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate) for ; Thu, 9 Apr 2015 12:33:58 +0200 (CEST) Received: by wgso17 with SMTP id o17so3509772wgs.1 for ; Thu, 09 Apr 2015 03:33:58 -0700 (PDT) X-Received: by 10.180.8.34 with SMTP id o2mr5009251wia.18.1428575638741; Thu, 09 Apr 2015 03:33:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 09 Apr 2015 10:33:58 +0000 Message-ID: To: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=f46d04428c127b69fb0513482f69 Subject: Re: [PHP-DEV] Exception message cleanup From: me@kelunik.com (Niklas Keller) --f46d04428c127b69fb0513482f69 Content-Type: text/plain; charset=UTF-8 Hi Nikita, I like the new display format, but there's one thing I miss. If you replace the exception name for warnings and fatals, how does a user know which exception he has to catch? Regards, Niklas Nikita Popov schrieb am Do., 09.04.2015, 10:04: > Hi internals! > > A lot of people have been confused about engine exceptions currently > displaying as normal fatal errors (if they aren't caught). We'll have to > change this to use exception messages. > > Before doing this I'd like to clean up the messages a bit to make them more > friendly for CLI usage. Currently the messages are so cluttered that it's > hard to find the actual error message if you're in an 80 char window. > > Patch is here: https://github.com/php/php-src/pull/1226 > > Previous message: > > Fatal error: Uncaught exception 'UnexpectedValueException' with message > 'Failed to open directory ""' in %s:%d > Stack trace: > #0 %s(%d): DirectoryIterator->__construct('\x00/abc') > #1 {main} > thrown in %s on line %d > > New message: > > UnexpectedValueException: Failed to open directory "" in %s on line %d > Stack trace: > #0 %s(%d): DirectoryIterator->__construct('\x00/abc') > #1 {main} > > Essentially exceptions would display like ordinary error, but with "Fatal > error" / "Warning" / ... replaced by the exception name, and showing a > stack trace after the error. > > A side-effect of the change is that uncaught exceptions will always be > displayed canonically and not based on __toString output. To modify display > of exception output, people should modify the respective properties of the > exception. > > Any objections to this? > > Thanks, > Nikita > --f46d04428c127b69fb0513482f69--