Module error

Source
Expand description

Functions to throw JavaScript exceptions from Rust.

Staticsยง

ERROR_FORMAT_STRING_STRING ๐Ÿ”’
Format string used to throw javascript errors.
RANGE_ERROR_FORMAT_STRING ๐Ÿ”’
Format string struct used to throw RangeErrors.
TYPE_ERROR_FORMAT_STRING ๐Ÿ”’
Format string struct used to throw TypeErrors.

Functionsยง

get_error_message ๐Ÿ”’ โš 
Callback used to throw javascript errors. See throw_js_error for info about error_number.
throw_internal_errorโš 
Throw an InternalError with the given message.
throw_js_error ๐Ÿ”’ โš 
Helper fn to throw a javascript error with the given message and number. Reuse the jsapi error codes to distinguish the error_number passed back to the get_error_message callback. c_uint is u32, so this cast is safe, as is casting to/from i32 from there.
throw_range_errorโš 
Throw a RangeError with the given message.
throw_type_errorโš 
Throw a TypeError with the given message.