From 133088a4372a736b91c3931d0e909e5d2e0468f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Laban?= Date: Wed, 23 Jan 2019 15:50:55 -0500 Subject: [PATCH] Update GetScriptSource more async, show exception message. --- sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs index 398d884f9d8..d886212389b 100644 --- a/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs +++ b/sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs @@ -657,7 +657,7 @@ namespace WsProxy { try { if (src_file.OriginalSourcePath.IsFile) { using (var f = new StreamReader (File.Open (src_file.OriginalSourcePath.LocalPath, FileMode.Open))) { - res.Write (f.ReadToEnd ()); + await res.WriteAsync (await f.ReadToEndAsync ()); } var o = JObject.FromObject (new { @@ -667,7 +667,7 @@ namespace WsProxy { SendResponse (msg_id, Result.Ok (o), token); } else { var doc = await new WebClient ().DownloadStringTaskAsync (src_file.OriginalSourcePath); - res.Write (doc); + await res.WriteAsync (doc); var o = JObject.FromObject (new { scriptSource = res.ToString () @@ -677,7 +677,7 @@ namespace WsProxy { } } catch (Exception e) { var o = JObject.FromObject (new { - scriptSource = $"// Unable to find document {src_file.OriginalSourcePath}" + scriptSource = $"// Unable to find document {src_file.OriginalSourcePath} ({e.Message})" }); SendResponse (msg_id, Result.Ok (o), token); -- 2.11.4.GIT