|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-05-09 10:51 UTC] michael dot caplan at henryschein dot com
Description: ------------ Reading through the docs, I understand that it is by design that business exceptions are relayed to the end user wholesale (IE: including backtrace, file, line, etc), and wrapped up in the binding native error structure. For my purpose, I would like to relay exceptions to the end user, but I would like to suppress everything with the exception of the exception description and number. Exposing files and backtraces in exceptions to the end user I think is too much info to expose (for security reasons, and simplicity). I don't see the value in having all this exposed to the end user, but I am sure there is a good reason. Perhaps a setting could be put into place that would suppress all exception details except the message and code? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 20:00:01 2025 UTC |
Hi Matthew, As an implementation suggestion for the soap Wrapper binding, I did the following: try { $return = call_user_func_array(array(&$this->instance_of_the_base_class, $method_name), $new_arguments_array); } catch ( Exception $e ) { if ($e instanceof SoapFault) { throw $e; } else { throw new SoapFault('Client', $e->getMessage()); } } I think this adequately re bundles the generic exception as a SoapFault, but also will just carry forward the exception as a SoapFault -- should it be formated as such. This allows me to have greater controller over Soap based exceptions, should I wish to return a specific SoapFault (with specific faultcode, faultstring, faultactor or details). Since SoapFaults extend the core Exception class they could be handled easily in any other binding agnostically.