Re: Exceptions, stack traces, and serialization
| From: | Rowan Collins | Date: | Tue, 08 Oct 2013 08:26:12 +0000 |
| Subject: | Re: Exceptions, stack traces, and serialization | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69515@lists.php.net to get a copy of this message | ||
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 StarlingThe 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]