Jasonette / JASONETTE-iOS

📡 Native App over HTTP, on iOS
https://www.jasonette.com
MIT License
5.27k stars 352 forks source link

$href action - request for error callback #353

Open hanyg opened 5 years ago

hanyg commented 5 years ago

Hello,

I am using the $href action on the main view of my application. While testing with network connectivity off I noticed that href does not support an error callback if it can't reach the URL. In my case, I just want a simple way of handling the connectivity issue by displaying an alert or something similar. What actually happens is my customized error.json is brought into view. So, my application is not crashing, but it would be preferable to explicitly handle it vs. a global error handler.

Would an error callback on an $href action be something that could be easily added?

Thanks, Hany

darenr commented 5 years ago

I think there's two types of error, the one caught by the app at the top level isn't the same as an http error. I've seen $href's trigger local error callbacks, but switching the phone to airplane mode triggers the app-level callback json.

hanyg commented 5 years ago

Thanks for the feedback. I’ve never been able to get $href to trigger an error callback. The success works with $ok. But based on the documentation I didn’t think that was supported. I’m using the general error handler for now. Maybe in the future there will be a more specific way to handle the error.