From 6097c26cdbe3be3d852373b5dfee44ea22d402f5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 26 Sep 2022 04:02:27 +0200 Subject: [PATCH] try catch around monaco services --- frontend/src/lib/components/Editor.svelte | 29 ++++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/frontend/src/lib/components/Editor.svelte b/frontend/src/lib/components/Editor.svelte index e5cbb3b6d0..5f92c55ae4 100644 --- a/frontend/src/lib/components/Editor.svelte +++ b/frontend/src/lib/components/Editor.svelte @@ -40,9 +40,13 @@ updateOptions } from '$lib/editorUtils' - StandaloneServices.initialize({ - ...getMessageServiceOverride(document.body) - }) + try { + StandaloneServices.initialize({ + ...getMessageServiceOverride(document.body) + }) + } catch (e) { + console.error(e) + } let divEl: HTMLDivElement | null = null let editor: monaco.editor.IStandaloneCodeEditor @@ -230,12 +234,19 @@ if (name == 'deno') { command && command.dispose() command = undefined - command = vscode.commands.registerCommand('deno.cache', (uris: DocumentUri[] = []) => { - languageClient.sendRequest(new RequestType('deno/cache'), { - referrer: { uri }, - uris: uris.map((uri) => ({ uri })) - }) - }) + try { + command = vscode.commands.registerCommand( + 'deno.cache', + (uris: DocumentUri[] = []) => { + languageClient.sendRequest(new RequestType('deno/cache'), { + referrer: { uri }, + uris: uris.map((uri) => ({ uri })) + }) + } + ) + } catch (err) { + console.error(err) + } } websocketAlive[name] = true