We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6025f17 commit c10a10aCopy full SHA for c10a10a
src/clients/fs/FileSystemAccessApiFsClient.ts
@@ -231,12 +231,18 @@ export class FileSystemAccessApiFsClient implements FsClient {
231
232
return targetDir
233
} catch (error: any) {
234
- const { name } = error
235
- switch (name) {
236
- case ErrorNames.NotFoundError: throw new ENOENT(path)
237
- case ErrorNames.TypeMismatchError: throw new ENOTDIR(path)
238
- default: throw error
+ if (error instanceof TypeError) {
+ throw new ENOTDIR(path)
239
}
+
+ if (error instanceof DOMException) {
+ switch (error.name) {
240
+ case ErrorNames.NotFoundError: throw new ENOENT(path)
241
+ case ErrorNames.TypeMismatchError: throw new ENOTDIR(path)
242
+ }
243
244
245
+ throw error
246
247
248
0 commit comments