mirror of
				https://github.com/lightpanda-io/browser.git
				synced 2025-10-30 15:41:48 +00:00 
			
		
		
		
	improve event's log result
This commit is contained in:
		| @@ -251,12 +251,12 @@ pub const EventHandler = struct { | |||||||
|                 Event.toInterface(evt) catch unreachable, |                 Event.toInterface(evt) catch unreachable, | ||||||
|             }, &res) catch |e| log.err("event handler error: {any}", .{e}); |             }, &res) catch |e| log.err("event handler error: {any}", .{e}); | ||||||
|         } else { |         } 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. |         // in case of function error, we log the result and the trace. | ||||||
|         if (!res.success) { |         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"}); |             log.debug("{s}", .{res.stack orelse "no stack trace"}); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -382,7 +382,11 @@ pub const XMLHttpRequest = struct { | |||||||
|         self.reset(alloc); |         self.reset(alloc); | ||||||
|  |  | ||||||
|         self.url = try alloc.dupe(u8, url); |         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.sync = if (asyn) |b| !b else false; | ||||||
|  |  | ||||||
|         self.state = OPENED; |         self.state = OPENED; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Pierre Tachoire
					Pierre Tachoire