Skip to content

Commit c3d33d8

Browse files
committed
fix: Promise.reject should return error for reason
Signed-off-by: joeriddles <joeriddles10@gmail.com>
1 parent e9124ba commit c3d33d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/fileService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class VaultFileService implements VaultFileService {
3737
if (file instanceof TFile) {
3838
return await this.vault.cachedRead(file);
3939
}
40-
return Promise.reject("not a TFile");
40+
return Promise.reject(new Error("not a TFile"));
4141
}
4242

4343
async updateFile(file: IFile, data: string): Promise<void> {
4444
if (file instanceof TFile) {
4545
await this.vault.modify(file, data);
4646
}
47-
return Promise.reject("not a TFile");
47+
return Promise.reject(new Error("not a TFile"));
4848
}
4949

5050
async checkExists(filepath: string): Promise<boolean> {

0 commit comments

Comments
 (0)