From 38fc7da2a9cff329c3b4975d9f01c16c10b572e9 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 26 Dec 2016 18:25:58 -0800 Subject: [feature] add support for authenticated API to bitmask.js --- ui/app/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index a27cba6c..95e4283f 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -1,7 +1,6 @@ import bitmask from 'lib/bitmask' import Account from 'models/account' import Provider from 'models/provider' -import EventLogger from 'lib/event_logger' class Application { constructor() { @@ -11,7 +10,8 @@ class Application { // main entry point for the application // initialize() { - this.ev = new EventLogger() + window.addEventListener("error", this.handleError.bind(this)) + window.addEventListener("unhandledrejection", this.handleError.bind(this)) if (this.debugging()) { this.show(this.debug_panel) } else { @@ -45,6 +45,10 @@ class Application { this.debug_panel = window.location.hash.replace('#', '') return this.debug_panel && this.debug_panel != 'main' } + + handleError(e) { + this.show('error', {error: e}) + } } var App = new Application -- cgit v1.2.3