aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings/mecab-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings/mecab-controller.js')
-rw-r--r--ext/js/pages/settings/mecab-controller.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/js/pages/settings/mecab-controller.js b/ext/js/pages/settings/mecab-controller.js
index 9c55c9a0..f57bc3c9 100644
--- a/ext/js/pages/settings/mecab-controller.js
+++ b/ext/js/pages/settings/mecab-controller.js
@@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import {toError} from '../../core/to-error.js';
import {querySelectorNotNull} from '../../dom/query-selector.js';
import {yomitan} from '../../yomitan.js';
@@ -57,7 +58,7 @@ export class MecabController {
await yomitan.api.testMecab();
this._setStatus('Connection was successful', false);
} catch (e) {
- this._setStatus(e instanceof Error ? e.message : `${e}`, true);
+ this._setStatus(toError(e).message, true);
} finally {
this._testActive = false;
/** @type {HTMLButtonElement} */ (this._testButton).disabled = false;