In case of a timeout or lost connection error on legacy mode, client will return native instance in the case of android but a localized description in the case of iOS.
That is a problem when one wants to handle "connection offline" error and display a prompt.
The problem occurs in this line: https://github.com/nativescript-community/https/blob/master/src/https/request.ios.ts#L269
It would be more convenient if iOS returned the native error instance, just like android.
Ideally, one would be able to distinguish such an error (more or less) using a technique like the one below:
function isOfflineConnectionError(error): boolean {
let isOffline: boolean;
if (__ANDROID__) {
isOffline = error instanceof java.net.UnknownHostException;
} else {
isOffline = error instanceof NSError && error.code === -1009;
}
return isOffline;
}