错误处理


🌐 Error handling

Node-API 在错误处理方面既使用返回值,也使用 JavaScript 异常。以下各节将解释每种情况的处理方法。

🌐 Node-API uses both return values and JavaScript exceptions for error handling. The following sections explain the approach for each case.