mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
netsurf: add missing netsurf DOM errors
This commit is contained in:
@@ -91,6 +91,12 @@ pub const DOMException = struct {
|
||||
error.InvalidNodeType => "InvalidNodeTypeError",
|
||||
error.DataClone => "DataCloneError",
|
||||
error.NoError => unreachable,
|
||||
|
||||
// custom netsurf error
|
||||
error.UnspecifiedEventType => "UnspecifiedEventTypeError",
|
||||
error.DispatchRequest => "DispatchRequestError",
|
||||
error.NoMemory => "NoMemoryError",
|
||||
error.AttributeWrongType => "AttributeWrongTypeError",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -124,6 +130,12 @@ pub const DOMException = struct {
|
||||
error.InvalidNodeType => 24,
|
||||
error.DataClone => 25,
|
||||
error.NoError => unreachable,
|
||||
|
||||
// custom netsurf error
|
||||
error.UnspecifiedEventType => 128,
|
||||
error.DispatchRequest => 129,
|
||||
error.NoMemory => 130,
|
||||
error.AttributeWrongType => 131,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -339,6 +339,12 @@ pub const DOMError = error{
|
||||
Timeout,
|
||||
InvalidNodeType,
|
||||
DataClone,
|
||||
|
||||
// custom netsurf error
|
||||
UnspecifiedEventType,
|
||||
DispatchRequest,
|
||||
NoMemory,
|
||||
AttributeWrongType,
|
||||
};
|
||||
|
||||
const DOMException = c.dom_exception;
|
||||
@@ -363,6 +369,13 @@ fn DOMErr(except: DOMException) DOMError!void {
|
||||
c.DOM_INVALID_ACCESS_ERR => DOMError.InvalidAccess,
|
||||
c.DOM_VALIDATION_ERR => DOMError.Validation,
|
||||
c.DOM_TYPE_MISMATCH_ERR => DOMError.TypeMismatch,
|
||||
|
||||
// custom netsurf error
|
||||
c.DOM_UNSPECIFIED_EVENT_TYPE_ERR => DOMError.UnspecifiedEventType,
|
||||
c.DOM_DISPATCH_REQUEST_ERR => DOMError.DispatchRequest,
|
||||
c.DOM_NO_MEM_ERR => DOMError.NoMemory,
|
||||
c.DOM_ATTR_WRONG_TYPE_ERR => DOMError.AttributeWrongType,
|
||||
|
||||
else => unreachable,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user