You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, please tell me why when I use this.webr.FS.lookupPath(path) where path is some non-existent path - I get an error instead of, say, null or undefined.
Because of this, I have to write hacks with try catch to check if something exists at the passed path.
The text was updated successfully, but these errors were encountered:
The webR.FS interface is a thin wrapper around Emscripten's File System API. Quoting from the Emscripten docs,
Emscripten predominantly compiles code that uses synchronous file I/O, so the majority of the FS member functions offer a synchronous interface (with errors being reported by raising exceptions of type FS.ErrnoError).
That is, for these functions throwing exceptions to be caught with try/catch is by design.
Saying that, there now exists a function FS.analyzePath in Emscripten which
[...]provides more information about given path and its parent. If any error occurs it won’t throw but returns an error property.
This sounds more like the behaviour you're looking for. Unfortunately, we don't currently expose FS.analyzePath on the webr object, but we can do so in a future release of webR.
Hi, please tell me why when I use this.webr.FS.lookupPath(path) where path is some non-existent path - I get an error instead of, say, null or undefined.
Because of this, I have to write hacks with try catch to check if something exists at the passed path.
The text was updated successfully, but these errors were encountered: