main.cpp: Catch exceptions when calling filesystem functions on node.js
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
64ef5e60ff
commit
dc380c8dcb
|
@ -59,8 +59,10 @@ int main(int argc, char* argv[]) {
|
||||||
if ((typeof process !== 'undefined') && (process.release.name === 'node')) {
|
if ((typeof process !== 'undefined') && (process.release.name === 'node')) {
|
||||||
const sub_directory = UTF8ToString($0);
|
const sub_directory = UTF8ToString($0);
|
||||||
if (!FS.isMountpoint(sub_directory)) {
|
if (!FS.isMountpoint(sub_directory)) {
|
||||||
FS.mkdir(sub_directory);
|
try {
|
||||||
FS.mount(NODEFS, {root: sub_directory}, sub_directory);
|
FS.mkdir(sub_directory);
|
||||||
|
FS.mount(NODEFS, {root: sub_directory}, sub_directory);
|
||||||
|
} catch (exception) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, sub_directory.c_str());
|
}, sub_directory.c_str());
|
||||||
|
|
Loading…
Reference in New Issue