meshprop npm模块崩溃,无法尝试/捕获异常

时间:2019-06-22 07:33:00

标签: javascript node.js npm node-gyp

当分析不受支持的文件格式(例如png)时,节点服务器崩溃,并弹出此错误:

libc++abi.dylib: terminating with uncaught exception of type std::length_error: vector
Abort trap: 6

即使尝试/捕获了相关代码,也未捕获到错误。有什么方法可以捕获此错误并防止其崩溃服务器?

提供给它的文件总是以结尾带有.stl的格式重命名。

try {

crashes here --->        meshprop.parse("renamedfile.stl", function(err, props) {
...(callback that never gets called with the .png)
}
}
catch(err)
{
console.log(err);
}

0 个答案:

没有答案