diff --git a/WebClient/web_client.android.ts b/WebClient/web_client.android.ts index 40677fd55..370b0b778 100644 --- a/WebClient/web_client.android.ts +++ b/WebClient/web_client.android.ts @@ -17,7 +17,7 @@ export module tk { com.koushikdutta.ion.Ion.with(context, url).asString().setCallback(new com.koushikdutta.async.future.FutureCallback({ onCompleted: function (e, result) { if (e && errorCallback) { - errorCallback(e.toString()); + errorCallback(new Error(e.toString())); return; } successCallback(result); @@ -55,7 +55,7 @@ export module tk { com.koushikdutta.ion.Ion.with(context, url).asBitmap().setCallback(new com.koushikdutta.async.future.FutureCallback({ onCompleted: function (e, result) { if (e && errorCallback) { - errorCallback(e.toString()); + errorCallback(new Error(e.toString())); return; } diff --git a/WebClient/web_client.ios.ts b/WebClient/web_client.ios.ts index 4864e6336..5eb733db3 100644 --- a/WebClient/web_client.ios.ts +++ b/WebClient/web_client.ios.ts @@ -55,7 +55,7 @@ export module tk { var dataTask = session.dataTaskWithURLCompletionHandler(Foundation.NSURL.URLWithString(url), function (data, response, error) { if (error) { if (errorCallback) { - errorCallback(error.description); + errorCallback(new Error(error.localizedDescription())); } } else if (successCallback) { successCallback(data);