summaryrefslogtreecommitdiff
path: root/ext/js/display/option-toggle-hotkey-handler.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/option-toggle-hotkey-handler.js')
-rw-r--r--ext/js/display/option-toggle-hotkey-handler.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/display/option-toggle-hotkey-handler.js b/ext/js/display/option-toggle-hotkey-handler.js
index 73c92d59..ba4c8578 100644
--- a/ext/js/display/option-toggle-hotkey-handler.js
+++ b/ext/js/display/option-toggle-hotkey-handler.js
@@ -18,6 +18,7 @@
import {generateId} from '../core.js';
import {ExtensionError} from '../core/extension-error.js';
+import {toError} from '../core/to-error.js';
import {yomitan} from '../yomitan.js';
export class OptionToggleHotkeyHandler {
@@ -132,7 +133,7 @@ export class OptionToggleHotkeyHandler {
* @returns {DocumentFragment}
*/
_createErrorMessage(path, error) {
- const message = error instanceof Error ? error.message : `${error}`;
+ const message = toError(error).message;
const fragment = document.createDocumentFragment();
const n1 = document.createElement('em');
n1.textContent = path;