diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-29 23:54:23 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-29 23:54:23 +0100 |
| commit | 4766a801382e6373b982a2731cdc7ea24f0c70b3 (patch) | |
| tree | a5c52510d026198afa6784b43b64ddcb3e14edf1 /webAO/utils | |
| parent | 5bb9834817ab14aba2517f7ff76bb5eb97ea0bee (diff) | |
Catch errors in fileExists
Diffstat (limited to 'webAO/utils')
| -rw-r--r-- | webAO/utils/fileExists.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/webAO/utils/fileExists.ts b/webAO/utils/fileExists.ts index 06621e4..f1a9924 100644 --- a/webAO/utils/fileExists.ts +++ b/webAO/utils/fileExists.ts @@ -3,5 +3,7 @@ export default async function fileExists(url: string): Promise<boolean> { method: 'HEAD', }).then((response) => { return response.ok; + }).catch(() => { + return false; }); } |
