mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-04-03 16:10:29 +00:00
browser: treat wait timeout as normal completion, not an error
This commit is contained in:
@@ -93,7 +93,7 @@ fn _wait(self: *Runner, comptime is_cdp: bool, opts: WaitOpts) !CDPWaitResult {
|
|||||||
|
|
||||||
const ms_elapsed: u32 = @intCast(timer.read() / std.time.ns_per_ms);
|
const ms_elapsed: u32 = @intCast(timer.read() / std.time.ns_per_ms);
|
||||||
if (ms_elapsed >= opts.ms) {
|
if (ms_elapsed >= opts.ms) {
|
||||||
return error.Timeout;
|
return .done;
|
||||||
}
|
}
|
||||||
if (next_ms > 0) {
|
if (next_ms > 0) {
|
||||||
std.Thread.sleep(std.time.ns_per_ms * next_ms);
|
std.Thread.sleep(std.time.ns_per_ms * next_ms);
|
||||||
|
|||||||
@@ -699,7 +699,7 @@ fn performGoto(server: *Server, url: [:0]const u8, id: std.json.Value, timeout:
|
|||||||
.ms = timeout orelse 10000,
|
.ms = timeout orelse 10000,
|
||||||
.until = waitUntil orelse .done,
|
.until = waitUntil orelse .done,
|
||||||
}) catch {
|
}) catch {
|
||||||
try server.sendError(id, .InternalError, "Timeout waiting for page load");
|
try server.sendError(id, .InternalError, "Error waiting for page load");
|
||||||
return error.NavigationFailed;
|
return error.NavigationFailed;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user