diff options
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r-- | ext/js/display/display.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js index ff77d203..7e7dd426 100644 --- a/ext/js/display/display.js +++ b/ext/js/display/display.js @@ -21,6 +21,7 @@ import {FrameEndpoint} from '../comm/frame-endpoint.js'; import {DynamicProperty, EventDispatcher, EventListenerCollection, clone, deepEqual, log, promiseTimeout} from '../core.js'; import {extendApiMap, invokeApiMapHandler} from '../core/api-map.js'; import {ExtensionError} from '../core/extension-error.js'; +import {toError} from '../core/to-error.js'; import {PopupMenu} from '../dom/popup-menu.js'; import {querySelectorNotNull} from '../dom/query-selector.js'; import {ScrollElement} from '../dom/scroll-element.js'; @@ -787,7 +788,7 @@ export class Display extends EventDispatcher { break; } } catch (e) { - this.onError(e instanceof Error ? e : new Error(`${e}`)); + this.onError(toError(e)); } } @@ -922,7 +923,7 @@ export class Display extends EventDispatcher { }; this.setContent(details); } catch (error) { - this.onError(error instanceof Error ? error : new Error(`${error}`)); + this.onError(toError(error)); } } |