[TYPO3-dev] [SOLVED] Re: try and catch a soap warning...

Jigal van Hemert jigal at xs4all.nl
Wed Jan 20 08:49:55 CET 2010


Hi Masi,

Martin Kutschker wrote:
> Jigal van Hemert schrieb:
>> "Funny" how PHP throws an exception and *still* displays error messages...
> 
> Why should this be related? The code executed within the constructor (or any other method/function)
> can issue tons of warnings before it decides to throw an error.

First of all the SoapClient class is a PHP extension, so there is not 
much you can do about the inner workings.

Another thing is that the SoapClient constructor accepts a series of 
options and one of them is called "exceptions":
"The /exceptions/ option is a boolean value defining whether soap errors 
throw exceptions of type _SoapFault_."
Maybe I don't understand this option very well, but this could either 
mean that you can tell SoapClient to use exceptions instead of 
error/warnings/etc. or it could mean that the exceptions it throws will 
be of type SoapFault.

Since it throws exceptions without setting this option to TRUE, it could 
  mean that either the option is "on" by default, or that it normally 
throws exceptions of type Exception.

Anyway, it would expect an object to either use exceptions or errors, 
not both. Using both will make exceptions less useful. It's nice to use 
a try/catch constructions, but you still need an error handler to catch 
the rest of the errors.

Regards, Jigal.




More information about the TYPO3-dev mailing list