From a307295d6fcaa6c1eff1c7fc6492efcb7a428e18 Mon Sep 17 00:00:00 2001 From: Vasil Chimev Date: Wed, 12 Dec 2018 12:48:29 +0200 Subject: [PATCH] refactor(Async): update onError of CompleteCallback interface (#149) * refactor(Async): update onError of CompleteCallback interface Include the error that occurs. * refactor(Async): swap onError parameters --- .../main/java/org/nativescript/widgets/Async.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/widgets/src/main/java/org/nativescript/widgets/Async.java b/android/widgets/src/main/java/org/nativescript/widgets/Async.java index a357814da..5ed78364f 100644 --- a/android/widgets/src/main/java/org/nativescript/widgets/Async.java +++ b/android/widgets/src/main/java/org/nativescript/widgets/Async.java @@ -56,7 +56,7 @@ public class Async { public interface CompleteCallback { void onComplete(Object result, Object tag); - void onError(Object tag); + void onError(String error, Object tag); } static class PriorityThreadFactory implements ThreadFactory { @@ -194,7 +194,7 @@ public class Async { if (result != null) { this.callback.onComplete(result, this.context); } else { - this.callback.onError(this.context); + this.callback.onError("DownloadImageTask returns no result.", this.context); } } } @@ -227,7 +227,7 @@ public class Async { if (result != null) { this.callback.onComplete(result, this.requestId); } else { - this.callback.onError(this.requestId); + this.callback.onError("LoadImageFromResourceTask returns no result.", this.requestId); } } } @@ -250,7 +250,7 @@ public class Async { if (result != null) { this.callback.onComplete(result, this.requestId); } else { - this.callback.onError(this.requestId); + this.callback.onError("LoadImageFromFileTask returns no result.", this.requestId); } } } @@ -274,7 +274,7 @@ public class Async { if (result != null) { this.callback.onComplete(result, this.requestId); } else { - this.callback.onError(this.requestId); + this.callback.onError("LoadImageFromBase64StringTask returns no result.", this.requestId); } } } @@ -572,7 +572,7 @@ public class Async { if (result != null) { this.callback.onComplete(result, this.context); } else { - this.callback.onError(this.context); + this.callback.onError("HttpRequestTask returns no result.", this.context); } }