PDA

View Full Version : Better Error handling - SOAP errors


the-ferret
28-08-07, 21:19
All

Interesting that we are still seeing SOAP errors and for those that have a bog standard install that means error messages shown on the site. The Shopwindow site is also returning empty searches and category trees but does not show error messages.

Can anyone give us a steer on how to suppress/handle to soap errors to gracefully degrade the site?

regards
Graham

the-ferret
28-08-07, 21:30
Actually might have answered this myself, wandering around the code found this in class.api_client.php

// print SoapFaults
if (PS_PRINT_SOAP_ERRORS==true) {
print "<pre>".print_r($this->oSoapError)."</pre>"; }

so I guess i can manipulate this to rturn a null and record the error in a database for my perusal later.

the-ferret
28-08-07, 21:38
sorry for thinking out loud, got the answer, change the variable

define('PS_PRINT_SOAP_ERRORS', true);

to

define('PS_PRINT_SOAP_ERRORS', false);

in /includes/soap/constants.inc

Amoochi
30-08-07, 12:30
I may have to do that myself as a stop gap, these errors are looking extremely unprofessional and are a sure fire way of losing visitors and potential sales. But then again, a visitor clicking on something and not being presented with what they were expecting to see is just as big a way of losing visitors too.

What the entire thing needs is a much friendly system for errors, something which isn't going to scare visitors away and something which may actually make the visitor have a little patience and sympathy to the error so they would press refresh or come back again a little later... But that would be something the devs would need to do in the base pack, cause it would likely need far too may scripts customising to be practical when updated software packs come out.

the-ferret
30-08-07, 17:07
Amoochi

Agree completely. When I get some free time, I will play with the code to see if it is possible to force a refresh when a soap error is returned just to try again before showing a 'systems busy' please try later message. A shame that we are all competing for the same visitors, a contributions forum similar to oscommerce would be great to share ideas and updates.