Report errors on frontend

This commit is contained in:
Radon Rosborough 2020-06-22 21:04:22 -06:00
parent 3255a26d73
commit 881d8d6976
1 changed files with 13 additions and 0 deletions

View File

@ -42,6 +42,19 @@ export class Session {
this.run().catch((err) => {
this.log(`Error while setting up environment for pty`);
console.log(err);
try {
this.ws.send(JSON.stringify({ event: "terminalClear" }));
this.ws.send(
JSON.stringify({
event: "terminalOutput",
output: `Riju encountered an unexpected error: ${err}
\rYou may want to save your code and refresh the page.
`,
})
);
} catch (err) {
//
}
});
}
handleClientMessage = (event: string) => {