Skip to content

Commit 7bb3411

Browse files
author
Andrey Dobrikov
committed
Make sure we catch any internal exceptions and log them.
1 parent c732a15 commit 7bb3411

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

SDK/Runtime/EmbeddedWallet/BrowserDomIframeHandler.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,14 @@ private void InjectIframe(string url)
105105
Application.ExternalEval(jsCode);
106106

107107
// Trigger PingReadyUntilSuccessful after injecting the iframe
108-
_ = _webViewManager.PingReadyUntilSuccessful();
108+
_ = _webViewManager.PingReadyUntilSuccessful()
109+
.ContinueWith(t =>
110+
{
111+
if (t.IsFaulted)
112+
{
113+
PrivyLogger.Error("PingReadyUntilSuccessful threw", t.Exception);
114+
}
115+
}, TaskContinuationOptions.OnlyOnFaulted);
109116
}
110117
}
111118
}

SDK/Runtime/EmbeddedWallet/WebviewHandler.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@ internal void OnPageLoaded(string url)
6060
webViewObject.Wrapped.EvaluateJS(js); //Initialize Handlers
6161
PrivyLogger.Debug("Injected JavaScript into WebView.");
6262

63-
_ = _webViewManager.PingReadyUntilSuccessful();
63+
_ = _webViewManager.PingReadyUntilSuccessful()
64+
.ContinueWith(t =>
65+
{
66+
if (t.IsFaulted)
67+
{
68+
PrivyLogger.Error("PingReadyUntilSuccessful threw", t.Exception);
69+
}
70+
}, TaskContinuationOptions.OnlyOnFaulted);
71+
6472
}
6573

6674
public void SendMessage(string message)

0 commit comments

Comments
 (0)