mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
@@ -563,7 +563,7 @@ pub const Page = struct {
|
||||
|
||||
const resp = fetchres.req.response;
|
||||
|
||||
log.info("fech script {any}: {d}", .{ u, resp.status });
|
||||
log.info("fetch script {any}: {d}", .{ u, resp.status });
|
||||
|
||||
if (resp.status != .ok) return FetchError.BadStatusCode;
|
||||
|
||||
|
||||
@@ -251,12 +251,12 @@ pub const EventHandler = struct {
|
||||
Event.toInterface(evt) catch unreachable,
|
||||
}, &res) catch |e| log.err("event handler error: {any}", .{e});
|
||||
} else {
|
||||
data.cbk.trycall(.{event}, &res) catch |e| log.err("event handler error: {any}", .{e});
|
||||
data.cbk.trycall(.{event}, &res) catch |e| log.err("event handler error (null event): {any}", .{e});
|
||||
}
|
||||
|
||||
// in case of function error, we log the result and the trace.
|
||||
if (!res.success) {
|
||||
log.info("event handler error: {s}", .{res.result orelse "unknown"});
|
||||
log.info("event handler error try catch: {s}", .{res.result orelse "unknown"});
|
||||
log.debug("{s}", .{res.stack orelse "no stack trace"});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,7 +382,11 @@ pub const XMLHttpRequest = struct {
|
||||
self.reset(alloc);
|
||||
|
||||
self.url = try alloc.dupe(u8, url);
|
||||
self.uri = std.Uri.parse(self.url.?) catch return DOMError.Syntax;
|
||||
self.uri = std.Uri.parse(self.url.?) catch |err| {
|
||||
log.debug("parse url ({s}): {any}", .{ self.url.?, err });
|
||||
return DOMError.Syntax;
|
||||
};
|
||||
log.debug("open url ({s})", .{self.url.?});
|
||||
self.sync = if (asyn) |b| !b else false;
|
||||
|
||||
self.state = OPENED;
|
||||
|
||||
Reference in New Issue
Block a user