neon_runtime/nan/
error.rs1use crate::raw::{Isolate, Local};
4
5pub unsafe fn throw(_: Isolate, val: Local) {
7 neon_sys::Neon_Error_Throw(val)
8}
9
10pub unsafe fn new_error(_: Isolate, out: &mut Local, msg: Local) {
12 neon_sys::Neon_Error_NewError(out, msg)
13}
14
15pub unsafe fn new_type_error(_: Isolate, out: &mut Local, msg: Local) {
17 neon_sys::Neon_Error_NewTypeError(out, msg)
18}
19
20pub unsafe fn new_range_error(_: Isolate, out: &mut Local, msg: Local) {
22 neon_sys::Neon_Error_NewRangeError(out, msg)
23}
24
25pub unsafe fn throw_error_from_utf8(_: Isolate, msg: *const u8, len: i32) {
27 neon_sys::Neon_Error_ThrowErrorFromUtf8(msg, len)
28}