How to handle navigation error on API calls

Showing 1-5 of 5 messages
How to handle navigation error on API calls Prabu D 10/6/12 5:34 AM
Hi,

I would like to handle set a timeout problem in REST API calls.

1. if the internet connection is not available I want to through error message like "no network available" and 
2. suppose network is slow want to show error message like "connection problem" and 
3. how can I determine the response time taken by API call. Is there a way to get the response time taken in Rho AsyncHttp method?

Thanks in advance
Prabu D
Re: How to handle navigation error on API calls Jon Tara 10/6/12 9:39 AM
Just use the Ruby Time class. Save the current time when you make the call, and subtract from the time when you get the callback.
Re: [rhomobile] Re: How to handle navigation error on API calls Prabu D 10/11/12 12:50 AM
Thanks Jon Tara. But how can I handle Navigation Time out error ? Its appear on mobile screen when page load with API request / response takes some delay. 

On Sat, Oct 6, 2012 at 10:09 PM, Jon Tara <jtara-g...@spamex.com> wrote:
Just use the Ruby Time class. Save the current time when you make the call, and subtract from the time when you get the callback.

--
You received this message because you are subscribed to the Google Groups "rhomobile" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rhomobile/-/X8plRR5fyG8J.

To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to rhomobile+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhomobile?hl=en.



--
Thank You.


Regards,
Prabu D

Re: [rhomobile] Re: How to handle navigation error on API calls Jon Tara 10/11/12 8:15 AM
That's not what you asked. You asked how to measure the response time of REST API calls. I told you how to measure the response time.

It sounds like you are using a blocking call to AsyncHttp. Your controller is making a call and waiting for the result. If you make a blocking call and the server doesn't respond quickly enough, of course your page request is going to time-out.

Don't use a blocking call. Use callbacks.

I wish the docs would not encourage people to make blocking calls to AsyncHttp in controllers. It is a naive approach that is never going to make users happy.

Re: [rhomobile] Re: How to handle navigation error on API calls Prabu D 10/12/12 3:39 AM
Yes you are correct, right now I am using blocking calls,will use callbacks instead.

-- 
Thank You.


Regards,
Prabu D



--
You received this message because you are subscribed to the Google Groups "rhomobile" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rhomobile/-/DhS1zNbMeXoJ.

To post to this group, send email to rhom...@googlegroups.com.
To unsubscribe from this group, send email to rhomobile+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rhomobile?hl=en.