mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: suppress error for wrong error code (#12244)
This commit is contained in:
parent
e4ef9f13f5
commit
5f7254c41c
@ -37,6 +37,7 @@ import {TargetCloseError, UnsupportedOperation} from '../common/Errors.js';
|
||||
import type {TimeoutSettings} from '../common/TimeoutSettings.js';
|
||||
import type {Awaitable, NodeFor} from '../common/types.js';
|
||||
import {debugError, fromEmitterEvent, timeout} from '../common/util.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {BidiCdpSession} from './CDPSession.js';
|
||||
import type {BrowsingContext} from './core/BrowsingContext.js';
|
||||
@ -301,10 +302,18 @@ export class BidiFrame extends Frame {
|
||||
// readiness=interactive.
|
||||
//
|
||||
// Related: https://bugzilla.mozilla.org/show_bug.cgi?id=1846601
|
||||
this.browsingContext.navigate(
|
||||
url,
|
||||
Bidi.BrowsingContext.ReadinessState.Interactive
|
||||
),
|
||||
this.browsingContext
|
||||
.navigate(url, Bidi.BrowsingContext.ReadinessState.Interactive)
|
||||
.catch(error => {
|
||||
if (
|
||||
isErrorLike(error) &&
|
||||
error.message.includes('net::ERR_HTTP_RESPONSE_CODE_FAILURE')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}),
|
||||
]).catch(
|
||||
rewriteNavigationError(
|
||||
url,
|
||||
@ -352,11 +361,7 @@ export class BidiFrame extends Frame {
|
||||
}),
|
||||
raceWith(
|
||||
fromEmitterEvent(navigation, 'fragment'),
|
||||
fromEmitterEvent(navigation, 'failed').pipe(
|
||||
map(({url}) => {
|
||||
throw new Error(`Navigation failed: ${url}`);
|
||||
})
|
||||
),
|
||||
fromEmitterEvent(navigation, 'failed'),
|
||||
fromEmitterEvent(navigation, 'aborted').pipe(
|
||||
map(({url}) => {
|
||||
throw new Error(`Navigation aborted: ${url}`);
|
||||
|
@ -2538,20 +2538,6 @@
|
||||
"expectations": ["SKIP"],
|
||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[navigation.spec] navigation Page.goto should not throw an error for a 404 response with an empty body",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["FAIL"],
|
||||
"comment": "Chrome returns an error instead of the network request"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[navigation.spec] navigation Page.goto should not throw an error for a 500 response with an empty body",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
"parameters": ["chrome", "webDriverBiDi"],
|
||||
"expectations": ["FAIL"],
|
||||
"comment": "Chrome returns an error instead of the network request"
|
||||
},
|
||||
{
|
||||
"testIdPattern": "[navigation.spec] navigation Page.goto should send referer",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
Loading…
Reference in New Issue
Block a user