Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The getFileHandle() and getDirectoryHandle method can reject, but how and with what exception #68

Closed
kenchris opened this issue Jun 27, 2019 · 3 comments · Fixed by #168
Milestone

Comments

@kenchris
Copy link

In response to w3ctag/design-reviews#390

Returns a handle for a file named name in the directory represented by directoryHandle. If no such file exists, this rejects.

Do these reject with exception? Always the same type of exception etc? It is unclear

@mkruisselbrink
Copy link
Contributor

Woops, didn't actually mean for that PR to close this. There is still work left to better specify the possible exception types.

@billiegoose
Copy link

Yes, I would like these errors to be standardized as well. I currently am relying on the error message to provide an accurate emulation of Node's fs behavior:

try {
  dir = await dir.getDirectory(part);
} catch (e) {
  if (e.message === 'The path supplied exists, but was not an entry of requested type.') {
    throw new ENOTDIR(filepath);
  }
  throw new ENOENT(filepath);
}

@mkruisselbrink mkruisselbrink modified the milestones: MVP, V1 Jul 16, 2020
@mkruisselbrink mkruisselbrink changed the title The getFile() and getDirectory method can reject, but how and with what exception The getFileHandle() and getDirectoryHandle method can reject, but how and with what exception Feb 11, 2022
@a-sully
Copy link
Collaborator

a-sully commented Mar 7, 2022

This issue has been ported to the new spec: whatwg/fs#11

@a-sully a-sully closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants