diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-04-14 21:05:53 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2021-04-14 23:02:52 +0900 |
commit | 09ec6d49435d855f0b2e51c71ff7cedb059ecb86 (patch) | |
tree | e385785f9b9346e67f5ad51d66b9395226643dd2 /src | |
parent | 7293efa90edd927e5a310343401999310bf7dbc7 (diff) |
Show an error on mark not set
Diffstat (limited to 'src')
-rw-r--r-- | src/content/usecases/MarkUseCase.ts | 5 |
1 files changed, 3 insertions, 2 deletions
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<void> { 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); } |