From 54d132ffdb29772dddcc380dc9a5cbfc89d364cc Mon Sep 17 00:00:00 2001 From: cha0s Date: Sat, 11 May 2019 21:18:04 -0500 Subject: [PATCH] feat: show uncaught errors in overlay --- client/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/app.js b/client/app.js index ebfde7e..a0f9d92 100644 --- a/client/app.js +++ b/client/app.js @@ -22,6 +22,8 @@ import {Room, RoomView} from '@avocado/topdown'; import {augmentParserWithThroughput} from '../common/parser-throughput'; import {WorldTime} from '../common/world-time'; import {CycleTracker} from './cycle-tracker'; +import {showMessage} from './overlay'; + import Ui from './ui'; import DebugUi from './ui/debug'; @@ -574,3 +576,7 @@ export class App extends decorate(class {}) { } } + +window.addEventListener('error', (event) => { + showMessage(event.error); +});