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