The built-in Exception class in PHP is total crap. It is an inheritance nazi preventing you from doing useful stuff in your own exception classes. Whoever made its get*() methods final and the trace property private did not thought any second about how exceptions may be used or that people need to implement their own stack trace handling.
The reason I'm ranting about this is that I'm currently developing some classes that will interact directly with an application server and I need to map the exceptions thrown on the application server, delivered over the wire to my application, into my own exception classes. Of course the transferred exception contains a stack trace that I want to show within my application.
But I can not create an exception instance and overload the stack trace with that one delivered over the wire and then throw this exception. The PHP exception class forces me to implement another stack trace in my exceptions, but it is nonsense, because if the exception is thrown and not caught and has no proper __toString() implementation it will just show the senseless stack trace from where it was thrown within my application, not the stack trace from the application server. Instead of reusing existing code the built-in exception class forces me to implement my own stack trace handling, overload the __toString() method and rewrite all stuff to display the correct stack trace as it is known from the native stack trace handling. Additionally I have to remind all developers using my exception that they can not call the default methods to get the stack trace but that they need to use special methods on this exceptions. Not to talk about increased memory usage because the exception contains two stack traces now.
I am not sure exactly what you mean by "over the wire" but it sounds like some sort of remote procedure call (SOAP etc) -- if so, remember - remote procedure calls are not the same as local procedure calls -- an exception on a remote machine in no way should be expected to pass all its internals to you "over the wire" -- for many many good reasons -- if you are debugging the Application Server, then you should be able to have IT log its exceptions (nicely via subclassing even) and then look in the log on the application server host for your trace.
and if you do put all your exceptions goddies into your response, beware that people poking at your application server may be able to learn quite alot about it that way.
just my 2 cents.
oh - and as the child of a survivor or Auschwitz may I suggest that you think a bit more about the validity of likening to the Nazis some code that someone wrote for you to use for free.
Just my two cents, but I think Exception should be an interface with an AbstractException and a final ConcreteException.
That would allow you to do your own thing completely if you want to, then have some sort of internal set of exception_* functions to allow you to grab all of the current stack data if you wanted to put it in your custom implementation of Exception.
Some syntactic sugar making
throw "Something went terribly wrong";
throw new Exception ("Something went terribly wrong");
would be nice too.