Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69515 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11550 invoked from network); 8 Oct 2013 08:26:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Oct 2013 08:26:16 -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 74.125.83.48 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.83.48 mail-ee0-f48.google.com Received: from [74.125.83.48] ([74.125.83.48:53431] helo=mail-ee0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/45-09409-7A1C3525 for ; Tue, 08 Oct 2013 04:26:16 -0400 Received: by mail-ee0-f48.google.com with SMTP id l10so3727718eei.7 for ; Tue, 08 Oct 2013 01:26:13 -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=P9Na+UCsRLQ28BKF1yiQzSy4prj2RQW4NzfCxmOu/vs=; b=vk4es+4z6teB91AdY0+IHZQoapvo1pbUsMfYQpniC5P1KwS4uHI56ala670auNykHb mQbtBwnj5KCKIKwZ5fm5VSjRu9p9ly45ELPr7uUGt7r5faqitMEI3FF3IKxNR2189/3X fg1atTZzlZk/rYHpCbLyh7B3nFrtC00T1ME157PdNKWoqdI4Hv9An9EQzYi7u2M0DnhW a5j19up7lNZ6Kqc0XaEaOtE42YAteJnDj3n0E57JKCaX4p3RDMvSYr8aNhsUHYBE2eTL 35Hq5VslgFiIXZTtsCv4dg9YXLW+kKWmjNrOmbZAAAsEdwPj62Pi7zme63y7WPbpdot5 b9iw== X-Received: by 10.15.99.72 with SMTP id bk48mr622742eeb.22.1381220773380; Tue, 08 Oct 2013 01:26:13 -0700 (PDT) Received: from [192.168.0.131] ([62.189.198.114]) by mx.google.com with ESMTPSA id f49sm72984863eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Oct 2013 01:26:13 -0700 (PDT) Message-ID: <5253C1A4.8070303@gmail.com> Date: Tue, 08 Oct 2013 09:26:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: internals@lists.php.net References: <52532F2C.2010704@gmail.com> <52533D9D.5050203@wikimedia.org> In-Reply-To: <52533D9D.5050203@wikimedia.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Exceptions, stack traces, and serialization From: rowan.collins@gmail.com (Rowan Collins) Tim Starling wrote (on 08/10/2013): > Is it possible to make the trace options be overridable by the > Exception subclass? That would provide a migration path for any code > that did rely on the args being available. And I think our app could > benefit from having closure objects available for logging, especially > if it is possible to get line numbers. > > -- Tim Starling The problem with that is that you can't control what exceptions are thrown by third-party libraries (or even some of the newer core extensions), or force them to inherit from your base. If they turn off the argument capture, the information will already be unavailable when you catch the exception, and if they turn it on, you will still need a function to strip it after the fact. Obviously you can discard the third-party exception and throw your own, but normally you would chain yours onto it, retaining whatever information it originally contained. -- Rowan Collins [IMSoP]