ebidel / filer.js

A wrapper library for the HTML5 Filesystem API what reuses UNIX commands (cp, mv, ls) for its API.
Other
1.49k stars 155 forks source link

"getEntry_" should use the "opt_errorHandler" passed by "Filer.prototype.open" #33

Open bux opened 11 years ago

bux commented 11 years ago

You can't handle the error when the file you are trying to open does not exist.

beccasaurus commented 11 years ago

I just ran into this issue and sent a pull request (including updated method documentation and a test)

I noticed that there's also an existing pull request to fix this bug so that should also be closed. Note: that implementation is undocumented and untested but the same test could be used if that pull request's implementation is preferred.

For getEntry_ I followed the existing convention of ending the method signature with opt_errorHandler. I also followed the pattern of checking for opt_errorHandler else throw(e).