AJAX requests which fail silently ?

View: New views
7 Messages — Rating Filter:   Alert me  

AJAX requests which fail silently ?

by Alain BAUDHUIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Message
Hi,
 
I'm an enthusiast user of  HTML_AJAX for some time already. I'm mainly exposing PHP classes using stubs, and I've provided my version of  HTML_AJAX.onError= function(e) { (...) }which works just fine.
 
But now I'm facing the fact that some some of the exposed functions should not perform any error reporting to the user in case of failure, (eg. server not available),. At some places, asynchronous calls to no-error-reporting-methods and standard-error-reporting-methods can be mixed, so I cannot possibly remove and restore the error handler.  Is there any way to inhibit error reporting on some of the exposed methods and not others ?
 
My only other idea would be to instanciate a second HTML_AJAX object, with an empty onError function, but is this even possible since HTML_AJAX is a global ?
 
Thanks for any hint,
 
Alain. 
 
_____________________
Alain BAUDHUIN
 

_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

Re: AJAX requests which fail silently ?

by JoshuaEichorn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Alain BAUDHUIN wrote:

> Hi,
>  
> I'm an enthusiast user of  HTML_AJAX for some time already. I'm mainly
> exposing PHP classes using stubs, and I've provided my version of  
> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>  
> But now I'm facing the fact that some some of the exposed functions
> should not perform any error reporting to the user in case of failure,
> (eg. server not available),. At some places, asynchronous calls to
> no-error-reporting-methods and standard-error-reporting-methods can be
> mixed, so I cannot possibly remove and restore the error handler.  Is
> there any way to inhibit error reporting on some of the exposed
> methods and not others ?
>  
> My only other idea would be to instanciate a second HTML_AJAX object,
> with an empty onError function, but is this even possible since
> HTML_AJAX is a global ?
>  
> Thanks for any hint,
>  
> Alain.
>  
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@... <mailto:alain.baudhuin@...>
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel@...
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>  
You should be able to set error handlers at the call level, with the
global handler used if thats not set.

I can give you an example if I know what your doing (proxies,
HTML_AJAX.post, etc etc)

-josh
_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

Re: AJAX requests which fail silently ?

by Laurent Yaish :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alain,

aren't you catching the error in your PHP class? if so then you could
handle it there and error silently
The exposed methods from the stub don't do anything but map to your PHP class

Laurent

On Nov 30, 2007 12:52 PM, Alain BAUDHUIN <alain.baudhuin@...> wrote:

>
>
> Hi,
>
> I'm an enthusiast user of  HTML_AJAX for some time already. I'm mainly
> exposing PHP classes using stubs, and I've provided my version of
> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>
> But now I'm facing the fact that some some of the exposed functions should
> not perform any error reporting to the user in case of failure, (eg. server
> not available),. At some places, asynchronous calls to
> no-error-reporting-methods and standard-error-reporting-methods can be
> mixed, so I cannot possibly remove and restore the error handler.  Is there
> any way to inhibit error reporting on some of the exposed methods and not
> others ?
>
> My only other idea would be to instanciate a second HTML_AJAX object, with
> an empty onError function, but is this even possible since HTML_AJAX is a
> global ?
>
> Thanks for any hint,
>
> Alain.
>
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@...
>
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel@...
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>
>
_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

RE : AJAX requests which fail silently ?

by Alain BAUDHUIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josh,

Setting error handlers at call-level sound exactly like the solution I need.
For those 'silently failing' calls, I'm only using Remote Stubs, as
demonstrated in listing 9-4 in your book.

Thanks in advance,
Alain.

_____________________
Alain BAUDHUIN
alain.baudhuin@...


-----Message d'origine-----
De : Joshua Eichorn [mailto:josh@...]
Envoyé : vendredi 30 novembre 2007 22:07
À : Alain BAUDHUIN
Cc : html_ajax-devel@...
Objet : Re: [HTML_AJAX-devel] AJAX requests which fail silently ?


Alain BAUDHUIN wrote:

> Hi,
>  
> I'm an enthusiast user of  HTML_AJAX for some time already. I'm mainly
> exposing PHP classes using stubs, and I've provided my version of  
> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>  
> But now I'm facing the fact that some some of the exposed functions
> should not perform any error reporting to the user in case of failure,
> (eg. server not available),. At some places, asynchronous calls to
> no-error-reporting-methods and standard-error-reporting-methods can be
> mixed, so I cannot possibly remove and restore the error handler.  Is
> there any way to inhibit error reporting on some of the exposed
> methods and not others ?
>  
> My only other idea would be to instanciate a second HTML_AJAX object,
> with an empty onError function, but is this even possible since
> HTML_AJAX is a global ?
>  
> Thanks for any hint,
>  
> Alain.
>  
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@... <mailto:alain.baudhuin@...>
>  
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> Html_ajax-devel mailing list
> Html_ajax-devel@...
> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>  
You should be able to set error handlers at the call level, with the
global handler used if thats not set.

I can give you an example if I know what your doing (proxies,
HTML_AJAX.post, etc etc)

-josh


_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

Re: RE : AJAX requests which fail silently ?

by JoshuaEichorn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Adding the custom error handler on remote stubs is a little ugly but it
works.

You just have to add an onError function to the dispatchers options array

http://bluga.net/projects/HTML_AJAX/examples/error.php

For a quick example.

-josh
Alain BAUDHUIN wrote:

> Josh,
>
> Setting error handlers at call-level sound exactly like the solution I need.
> For those 'silently failing' calls, I'm only using Remote Stubs, as
> demonstrated in listing 9-4 in your book.
>
> Thanks in advance,
> Alain.
>
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@...
>
>
> -----Message d'origine-----
> De : Joshua Eichorn [mailto:josh@...]
> Envoyé : vendredi 30 novembre 2007 22:07
> À : Alain BAUDHUIN
> Cc : html_ajax-devel@...
> Objet : Re: [HTML_AJAX-devel] AJAX requests which fail silently ?
>
>
> Alain BAUDHUIN wrote:
>  
>> Hi,
>>  
>> I'm an enthusiast user of  HTML_AJAX for some time already. I'm mainly
>> exposing PHP classes using stubs, and I've provided my version of  
>> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>>  
>> But now I'm facing the fact that some some of the exposed functions
>> should not perform any error reporting to the user in case of failure,
>> (eg. server not available),. At some places, asynchronous calls to
>> no-error-reporting-methods and standard-error-reporting-methods can be
>> mixed, so I cannot possibly remove and restore the error handler.  Is
>> there any way to inhibit error reporting on some of the exposed
>> methods and not others ?
>>  
>> My only other idea would be to instanciate a second HTML_AJAX object,
>> with an empty onError function, but is this even possible since
>> HTML_AJAX is a global ?
>>  
>> Thanks for any hint,
>>  
>> Alain.
>>  
>> _____________________
>> Alain BAUDHUIN
>> alain.baudhuin@... <mailto:alain.baudhuin@...>
>>  
>> ----------------------------------------------------------------------
>> --
>>
>> _______________________________________________
>> Html_ajax-devel mailing list
>> Html_ajax-devel@...
>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>  
>>    
> You should be able to set error handlers at the call level, with the
> global handler used if thats not set.
>
> I can give you an example if I know what your doing (proxies,
> HTML_AJAX.post, etc etc)
>
> -josh
>
>
>  

_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

RE : RE : AJAX requests which fail silently ?

by Alain BAUDHUIN :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Josh,
Thanks for the example, but would this technique not replace the handler for
any method I would call on any remote object ? It is essential in my case
that I can use both 'silently failing' methods AND 'regularly failing'
methods in the page (and even with overlapping calls). I can obviously group
the silently failing methods in a dedicated remote object if it helps.

Thanks,
Alain.

_____________________
Alain BAUDHUIN
alain.baudhuin@...


-----Message d'origine-----
De : Joshua Eichorn [mailto:josh@...]
Envoyé : vendredi 30 novembre 2007 23:40
À : Alain BAUDHUIN
Cc : html_ajax-devel@...
Objet : Re: RE : [HTML_AJAX-devel] AJAX requests which fail silently ?


Adding the custom error handler on remote stubs is a little ugly but it
works.

You just have to add an onError function to the dispatchers options array

http://bluga.net/projects/HTML_AJAX/examples/error.php

For a quick example.

-josh
Alain BAUDHUIN wrote:

> Josh,
>
> Setting error handlers at call-level sound exactly like the solution I
> need. For those 'silently failing' calls, I'm only using Remote Stubs,
> as demonstrated in listing 9-4 in your book.
>
> Thanks in advance,
> Alain.
>
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@...
>
>
> -----Message d'origine-----
> De : Joshua Eichorn [mailto:josh@...]
> Envoyé : vendredi 30 novembre 2007 22:07
> À : Alain BAUDHUIN
> Cc : html_ajax-devel@...
> Objet : Re: [HTML_AJAX-devel] AJAX requests which fail silently ?
>
>
> Alain BAUDHUIN wrote:
>  
>> Hi,
>>  
>> I'm an enthusiast user of  HTML_AJAX for some time already. I'm
>> mainly exposing PHP classes using stubs, and I've provided my version of
>> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>>  
>> But now I'm facing the fact that some some of the exposed functions
>> should not perform any error reporting to the user in case of
>> failure, (eg. server not available),. At some places, asynchronous
>> calls to no-error-reporting-methods and
>> standard-error-reporting-methods can be mixed, so I cannot possibly
>> remove and restore the error handler.  Is there any way to inhibit
>> error reporting on some of the exposed methods and not others ?
>>  
>> My only other idea would be to instanciate a second HTML_AJAX object,
>> with an empty onError function, but is this even possible since
>> HTML_AJAX is a global ?
>>  
>> Thanks for any hint,
>>  
>> Alain.
>>  
>> _____________________
>> Alain BAUDHUIN
>> alain.baudhuin@... <mailto:alain.baudhuin@...>
>>  
>> ---------------------------------------------------------------------
>> -
>> --
>>
>> _______________________________________________
>> Html_ajax-devel mailing list
>> Html_ajax-devel@...
>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>  
>>    
> You should be able to set error handlers at the call level, with the
> global handler used if thats not set.
>
> I can give you an example if I know what your doing (proxies,
> HTML_AJAX.post, etc etc)
>
> -josh
>
>
>  



_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel

Re: RE : RE : AJAX requests which fail silently ?

by JoshuaEichorn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The custom handler is only used on the specific remote handler where its
set so everything else is still going to use the default handler.

-josh
Alain BAUDHUIN wrote:

> Josh,
> Thanks for the example, but would this technique not replace the handler for
> any method I would call on any remote object ? It is essential in my case
> that I can use both 'silently failing' methods AND 'regularly failing'
> methods in the page (and even with overlapping calls). I can obviously group
> the silently failing methods in a dedicated remote object if it helps.
>
> Thanks,
> Alain.
>
> _____________________
> Alain BAUDHUIN
> alain.baudhuin@...
>
>
> -----Message d'origine-----
> De : Joshua Eichorn [mailto:josh@...]
> Envoyé : vendredi 30 novembre 2007 23:40
> À : Alain BAUDHUIN
> Cc : html_ajax-devel@...
> Objet : Re: RE : [HTML_AJAX-devel] AJAX requests which fail silently ?
>
>
> Adding the custom error handler on remote stubs is a little ugly but it
> works.
>
> You just have to add an onError function to the dispatchers options array
>
> http://bluga.net/projects/HTML_AJAX/examples/error.php
>
> For a quick example.
>
> -josh
> Alain BAUDHUIN wrote:
>  
>> Josh,
>>
>> Setting error handlers at call-level sound exactly like the solution I
>> need. For those 'silently failing' calls, I'm only using Remote Stubs,
>> as demonstrated in listing 9-4 in your book.
>>
>> Thanks in advance,
>> Alain.
>>
>> _____________________
>> Alain BAUDHUIN
>> alain.baudhuin@...
>>
>>
>> -----Message d'origine-----
>> De : Joshua Eichorn [mailto:josh@...]
>> Envoyé : vendredi 30 novembre 2007 22:07
>> À : Alain BAUDHUIN
>> Cc : html_ajax-devel@...
>> Objet : Re: [HTML_AJAX-devel] AJAX requests which fail silently ?
>>
>>
>> Alain BAUDHUIN wrote:
>>  
>>    
>>> Hi,
>>>  
>>> I'm an enthusiast user of  HTML_AJAX for some time already. I'm
>>> mainly exposing PHP classes using stubs, and I've provided my version of
>>> HTML_AJAX.onError= function(e) { (...) }which works just fine.
>>>  
>>> But now I'm facing the fact that some some of the exposed functions
>>> should not perform any error reporting to the user in case of
>>> failure, (eg. server not available),. At some places, asynchronous
>>> calls to no-error-reporting-methods and
>>> standard-error-reporting-methods can be mixed, so I cannot possibly
>>> remove and restore the error handler.  Is there any way to inhibit
>>> error reporting on some of the exposed methods and not others ?
>>>  
>>> My only other idea would be to instanciate a second HTML_AJAX object,
>>> with an empty onError function, but is this even possible since
>>> HTML_AJAX is a global ?
>>>  
>>> Thanks for any hint,
>>>  
>>> Alain.
>>>  
>>> _____________________
>>> Alain BAUDHUIN
>>> alain.baudhuin@... <mailto:alain.baudhuin@...>
>>>  
>>> ---------------------------------------------------------------------
>>> -
>>> --
>>>
>>> _______________________________________________
>>> Html_ajax-devel mailing list
>>> Html_ajax-devel@...
>>> http://lists.bluga.net/mailman/listinfo/html_ajax-devel
>>>  
>>>    
>>>      
>> You should be able to set error handlers at the call level, with the
>> global handler used if thats not set.
>>
>> I can give you an example if I know what your doing (proxies,
>> HTML_AJAX.post, etc etc)
>>
>> -josh
>>
>>
>>  
>>    
>
>
>
>  

_______________________________________________
Html_ajax-devel mailing list
Html_ajax-devel@...
http://lists.bluga.net/mailman/listinfo/html_ajax-devel