Skip to content

Commit 0e1e6b2

Browse files
authored
Merge pull request #31 from joeriddles/fix-warnings-2
fix: more community warnings
2 parents e9124ba + db458da commit 0e1e6b2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,13 @@ export default class ExtendedTaskListsPlugin extends Plugin {
167167
let todoFile: TFile;
168168
try {
169169
todoFile = await vault.create(this.settings.todoFilename, "");
170-
} catch (_e) {
170+
} catch (e) {
171171
const todoFileOrNull = vault.getAbstractFileByPath(
172172
this.settings.todoFilename,
173173
);
174174
if (todoFileOrNull == null) {
175175
throw new Error(
176-
`Could not get or create the TODO file: ${this.settings.todoFilename}`,
176+
`Could not get or create the TODO file: ${this.settings.todoFilename}: ${e}`,
177177
);
178178
} else if (!(todoFileOrNull instanceof TFile)) {
179179
throw new Error(

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)