Module mozjs::error[][src]

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.