Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85748 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15744 invoked from network); 9 Apr 2015 08:04:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Apr 2015 08:04:45 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.48 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.48 mail-wg0-f48.google.com Received: from [74.125.82.48] ([74.125.82.48:35992] helo=mail-wg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/8A-40877-C9236255 for ; Thu, 09 Apr 2015 04:04:45 -0400 Received: by wgsk9 with SMTP id k9so89151718wgs.3 for ; Thu, 09 Apr 2015 01:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=B9XRI1CicIi1arVvFSpjD8DDSnPgvBuwhx22sH4T1Hw=; b=l4Y6dGSdXVInIrpMPv93J7Pti/FXOUML3j7Q+IjNGiZRHfj7ef3sRccK7Qiw9PiPUU Co6Ri3zXEZ7cVIRH8eI3xAOTt/t58eqxNpKXVCni3wDTNPM54VpWB6KcQE7/Zv6Nbj+L M+BV6Rla8H+z0gwgTWpoelJi/pPc9RraX9wwJwCX2ooahzEc6IgvDaIFP/r7606lpFP2 9FeHifKocCy/UAfEW/skdUAP+fNJQiPby3q4w3NHInzEl/Bx2xuKJSvlGUnzEhHY2PVW ZKVRy/4SWaJgTscxrmcSY9kXyIa/BbH53973sdkQvoOH+Sz/emgZ2jrOn0628J0kPrtV LKvg== MIME-Version: 1.0 X-Received: by 10.180.73.132 with SMTP id l4mr3979846wiv.27.1428566682159; Thu, 09 Apr 2015 01:04:42 -0700 (PDT) Received: by 10.27.86.133 with HTTP; Thu, 9 Apr 2015 01:04:42 -0700 (PDT) Date: Thu, 9 Apr 2015 10:04:42 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=f46d043c7e62a0d18e05134619d2 Subject: Exception message cleanup From: nikita.ppv@gmail.com (Nikita Popov) --f46d043c7e62a0d18e05134619d2 Content-Type: text/plain; charset=UTF-8 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 --f46d043c7e62a0d18e05134619d2--