Reputation: 12269
I'm wondering if there is a way to hide the stack trace in an Exception in PHP. I'm running a Zend Amf Server under ZF and would like to handle the faults on the front-end but showing the stack trace (faultDetail) isn't something I want to come across the line.
My next step is to over ride these faults and send my own object back, but I would rather over ride an Exception to just not show the trace.
Upvotes: 0
Views: 2338
Reputation: 3128
The stack trace is part of your ErrorController.php and /views/scripts/error
view scripts. Most people forget that they have created it once and can do with it whatever they please.
Also note that you usually use environments in ZF. With APPLICATION_ENV you can use them to show or hide events depending on your environment.
Upvotes: 1
Reputation: 18430
You can rewrite error.phtml
which, by default, is at application\views\scripts\error\error.phtml
to show whatever messages you want.
Look at application/controllors/ErrorController.php
to see how uncaught exceptions are handled.
Upvotes: 0
Reputation: 62395
You can write your own exception handler function which will do whatever you wish: http://php.net/manual/en/function.set-exception-handler.php
Upvotes: 0