Topic: Custom error treatment

Hi,
When an error happens after an asynchronous request (problem on server side), the client should be able to be notified about this error to make (optionaly) a custom treatment.

To make it quick, you can replace in xajax.js the following code (which happens twice)

alert(errorString);

by the following :

try {xajax_asynchError(errorString)} catch(e) {alert(errorString);}

If the client has implemented a xajax_asynchError(txt) method, it will be called, otherwise the usual alert pop up is displayed.

You can also make it cleaner by allowing to configure the callback name into the php side.

I'm using it and it works. Hope that helps.

Re: Custom error treatment

IS there really somebody running this website / forum ?

If you don't have the time to answer, plese turn off this forum, we waste our time trying to help this project...

Re: Custom error treatment

What version of xajax are using?

I believe xajax 0.5 already has facilities in place to handle server errors (including the ability to retry the operation)... check the version in SVN.

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct

Re: Custom error treatment

Sorry for the rude words. It seems 0.5 can do the job, I was using a former version. Bye!

Re: Custom error treatment

No problem!  I am sorry that your post went so long without an answer.

It is hard to balance between spending time developing (and fixing bugs) and answering posts in the forum... and because I typically use the 'Show new posts' link which shows only the last 24 hours... some posts slip by without me seeing them.

I'm glad that it is now working! big_smile

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct