From 6371c99ae7c35a09ee8c61c02e2f9450e43a44f1 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Thu, 6 Jul 2023 15:20:21 +0300 Subject: [PATCH] Hande GetOperationStatus API method error case; (#107) --- Runtime/Scripts/Tezos/API/TezosDataAPI.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Runtime/Scripts/Tezos/API/TezosDataAPI.cs b/Runtime/Scripts/Tezos/API/TezosDataAPI.cs index 2b1e5901..c4c93301 100644 --- a/Runtime/Scripts/Tezos/API/TezosDataAPI.cs +++ b/Runtime/Scripts/Tezos/API/TezosDataAPI.cs @@ -236,9 +236,16 @@ public IEnumerator GetOperationStatus(Action callback, string operationHa { var url = $"operations/{operationHash}/status"; var requestRoutine = GetJson(url); - return new CoroutineWrapper(requestRoutine, callback); + return new CoroutineWrapper( + coroutine: requestRoutine, + callback: callback, + errorHandler: error => + { + Logger.LogDebug($"Can't get operation {operationHash} status, {error.Message}"); + callback.Invoke(false); + }); } - + public IEnumerator GetLatestBlockLevel(Action callback) { var url = $"blocks/{System.DateTime.UtcNow:yyyy-MM-ddTHH:mm:ssZ}/level";