From 2bee717b09488bf0d6e78ef1e141f81f5fa875e6 Mon Sep 17 00:00:00 2001 From: Konstantin Karuna Date: Thu, 6 Jul 2023 15:17:34 +0300 Subject: [PATCH] Hande GetOperationStatus API method error case; --- 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";