Wren

Module web

What every other module shares: the error codes (Web IDL exceptions and DOMException names), the exception record of the calling module, and the entry point of a page module.

Exposed to: Window, Worker. Source: api/web.widl.

Odin: import "wren:core".

Types

enum Error : i32

The status of a function that raises: 0, or what went wrong. Promise rejections use the same codes.

membervalue
None0
Invalid_Handle-1A handle that is not live, or not of the kind the function takes.
Hierarchy-2HierarchyRequestError: the node cannot go there.
Not_Found-3NotFoundError, or a null result ("no such attribute", "no such entry").
Invalid_Argument-4An argument out of its range (an enum, an index, a size).
Attached-5A node that is still in the tree cannot be released.
Type-10TypeError.
Range-11RangeError.
Security-12SecurityError.
Quota-13QuotaExceededError.
Not_Supported-14NotSupportedError.
Syntax-15SyntaxError.
Abort-16AbortError.
Timeout-17TimeoutError.
Invalid_State-18InvalidStateError.
Data_Clone-19DataCloneError.
Network-20NetworkError (fetch failures; the message says why).
Encoding-21EncodingError.
Index_Size-22IndexSizeError.
Not_Allowed-23NotAllowedError.
Invalid_Access-24InvalidAccessError.
Invalid_Character-40InvalidCharacterError (a name that is not a valid XML name, a token with spaces...).
Namespace-41NamespaceError.
In_Use_Attribute-42InUseAttributeError.
Wrong_Document-43WrongDocumentError.
Invalid_Node_Type-44InvalidNodeTypeError.
Invalid_Modification-45InvalidModificationError.
No_Modification_Allowed-46NoModificationAllowedError.

export wb_main

void wb_main()

Called once the module is instantiated in a page (after the document is parsed), if the module exports it.

Functions

Exception_code

Error Exception_code()

The code of the last error a function raised to this module instance (0 when none did yet).

Host: Exception_code :: proc(c: ^Call) -> Api_Error

Exception_message

string Exception_message()

The message of that error ("" when it has none): what a DOMException's message would say.

Host: Exception_message :: proc(c: ^Call) -> string

Edit this page on GitHub