Skip to content

Commit

Permalink
Hande GetOperationStatus API method error case; (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna authored Jul 6, 2023
1 parent f34b8b6 commit 6371c99
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Runtime/Scripts/Tezos/API/TezosDataAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,16 @@ public IEnumerator GetOperationStatus(Action<bool?> callback, string operationHa
{
var url = $"operations/{operationHash}/status";
var requestRoutine = GetJson<bool?>(url);
return new CoroutineWrapper<bool?>(requestRoutine, callback);
return new CoroutineWrapper<bool?>(
coroutine: requestRoutine,
callback: callback,
errorHandler: error =>
{
Logger.LogDebug($"Can't get operation {operationHash} status, {error.Message}");
callback.Invoke(false);
});
}

public IEnumerator GetLatestBlockLevel(Action<int> callback)
{
var url = $"blocks/{System.DateTime.UtcNow:yyyy-MM-ddTHH:mm:ssZ}/level";
Expand Down

0 comments on commit 6371c99

Please sign in to comment.