Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86387 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45450 invoked from network); 25 May 2015 18:53:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2015 18:53:52 -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.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wg0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:35999] helo=mail-wg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/A1-36604-FBF63655 for ; Mon, 25 May 2015 14:53:52 -0400 Received: by wgbgq6 with SMTP id gq6so78995152wgb.3 for ; Mon, 25 May 2015 11:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=bdBer7kJA3QPFvLEMwJVtx+lOxDl8WGBgs3kbQlz12w=; b=oThmGvXY+6nOWiRVjnP0PItkd1+J7sEdjpZttXVyV3LFg1YbpGOvKKgm/ilEoeml1r sOkRxNGM+D9SNcYsKoTA3wTLoBXu7UzaecwSNw1sT2IZP8FdLouu/6Us5EbnyaY1GMlI Csc/mBrw+tnp9wmswY9RZqk2/UP+BWamO8JMmgfBqJZ3aWhmIAEQRPPotXmnEbAfmbUC jvyOybX8KmZDz8ZBOXe4pftBUDFze02pTObOiIF8yoQaLZoezdcXnTTYfy5gyFy9+mEk VnmyvZEW53VZSRgt6l0Vvy9oUqT91JGNYL0wWkYThIJ+e1YOYnprs5jZgs6mPJ/MQlf+ XB+w== MIME-Version: 1.0 X-Received: by 10.180.231.4 with SMTP id tc4mr34139664wic.27.1432580029197; Mon, 25 May 2015 11:53:49 -0700 (PDT) Received: by 10.27.86.160 with HTTP; Mon, 25 May 2015 11:53:49 -0700 (PDT) In-Reply-To: References: Date: Mon, 25 May 2015 20:53:49 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=001a1134cc28c0b0550516ec87ba Subject: Re: Exception message cleanup From: nikita.ppv@gmail.com (Nikita Popov) --001a1134cc28c0b0550516ec87ba Content-Type: text/plain; charset=UTF-8 On Thu, Apr 9, 2015 at 10:04 AM, Nikita Popov wrote: > 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. > An update on this: EngineException and TypeException now display as normal exceptions (including stack trace). ParseException still show as a "Parse error". I don't plan to change that one. Instead of the relatively aggressive message changes described above I've only landed a small tweak (see https://github.com/php/php-src/commit/3ae995f03c8f60c4a4c9718262545cf5a6a08da3), which fixes the problem with nested quotes but keeps current structure. Nikita --001a1134cc28c0b0550516ec87ba--