I’m at the point where I want to trap and handle network errors / lack of network in my app and gracefully degrade (or fail)
As I find it faster doing the initial iterations using ionic serve and Chrome, is there a quick way I can simulate a network failure in Chrome without disabling the network in the underlying OS?
Are there any recommendations in terms of a Chrome (or FF) plugin that would let me flip traffic on and off during tests, or is there anything command line related I could use?
This is 1.0.0-beta.13 / MacOS 10.9.5 / Chrome 38.0.2125.101
Literally seconds after posting, I notice that the version of Chrome I updated during the course of the post appears to have new features for mobile testing, including throttling as if the device is GPRS / EDGE / 3G. (and much better support for spoofing responsive design on mobile)
Unfortunately the option to operate offline also cuts the connect to the localhost / 127.0.0.1 address so none of the app. loads. Although this ability to throttle is a massive improvement, I’d still appreciate any pointers on flipping on and off access outside the local ionic server route.
After trying several Chrome extensions to whitelist / blacklist specific URLs etc. I’ve found that none of them seem to reliably enforce the failure that I want to see.
I’ve fallen back on a simpler route of creating an additional named Location in Network preferences. with an identical static IP address and subnet mask to my standard connection - 192.168.1.80 / 255.255.255.0 in my case - but no router / DNS server etc.
This allows ionic serve to do it’s job, but kills access to the external data sources I use, and can be flipped more or less instantly via “Apple” -> “Location”