Imperative Apex While Offline

Imperative Apex calls always fail when the client device is offline. When using imperative Apex in an offline-enabled mobile app, it’s essential to handle the possibility of a network failure error.

Treat errors as a normal, expected outcome, rather than a failure condition. Provide appropriate feedback to the user, and suggest alternative behavior, rather than treating the situation as unexpected.

Offline-savvy components expect to be offline at times, and know what to do when that happens.