Skip to content

Commit aa19c76

Browse files
committed
fix getFile with err
1 parent 94469c4 commit aa19c76

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/api.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,12 @@ export async function getFile(path: string): Promise<any> {
308308
path: path
309309
}
310310
let url = '/api/file/getFile';
311-
let file = await fetchSyncPost(url, data);
312-
return file;
311+
try {
312+
let file = await fetchSyncPost(url, data);
313+
return file;
314+
} catch (error_msg) {
315+
return null;
316+
}
313317
}
314318

315319
export async function putFile(path: string, isDir: boolean, file: any) {

0 commit comments

Comments
 (0)