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