From 09ec6d49435d855f0b2e51c71ff7cedb059ecb86 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Wed, 14 Apr 2021 21:05:53 +0900 Subject: Show an error on mark not set --- src/content/usecases/MarkUseCase.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/content') diff --git a/src/content/usecases/MarkUseCase.ts b/src/content/usecases/MarkUseCase.ts index 002fdee..f5f512c 100644 --- a/src/content/usecases/MarkUseCase.ts +++ b/src/content/usecases/MarkUseCase.ts @@ -18,7 +18,7 @@ export default class MarkUseCase { async set(key: string): Promise { const pos = this.scrollPresenter.getScroll(); if (this.globalKey(key)) { - this.client.setGloablMark(key, pos); + await this.client.setGloablMark(key, pos); await this.consoleClient.info(`Set global mark to '${key}'`); } else { this.repository.set(key, pos); @@ -32,7 +32,8 @@ export default class MarkUseCase { } else { const pos = this.repository.get(key); if (!pos) { - throw new Error("Mark is not set"); + await this.consoleClient.error("Mark is not set"); + return; } this.scroll(pos.x, pos.y); } -- cgit v1.2.3