* move uncaught exception out of exit$ * reintroduce original error, but as a log instead * change log level: error -> warning. also update copy to make it explicit that the error will be ignored Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9eed9ee39b
commit
db7794f536
|
@ -220,6 +220,17 @@ export class HeadlessChromiumDriverFactory {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const uncaughtExceptionPageError$ = Rx.fromEvent<Error>(page, 'pageerror').pipe(
|
||||||
|
map((err) => {
|
||||||
|
logger.warning(
|
||||||
|
i18n.translate('xpack.reporting.browsers.chromium.pageErrorDetected', {
|
||||||
|
defaultMessage: `Reporting encountered an uncaught error on the page that will be ignored: {err}`,
|
||||||
|
values: { err: err.toString() },
|
||||||
|
})
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const pageRequestFailed$ = Rx.fromEvent<puppeteer.HTTPRequest>(page, 'requestfailed').pipe(
|
const pageRequestFailed$ = Rx.fromEvent<puppeteer.HTTPRequest>(page, 'requestfailed').pipe(
|
||||||
map((req) => {
|
map((req) => {
|
||||||
const failure = req.failure && req.failure();
|
const failure = req.failure && req.failure();
|
||||||
|
@ -231,7 +242,7 @@ export class HeadlessChromiumDriverFactory {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return Rx.merge(consoleMessages$, pageRequestFailed$);
|
return Rx.merge(consoleMessages$, uncaughtExceptionPageError$, pageRequestFailed$);
|
||||||
}
|
}
|
||||||
|
|
||||||
getProcessLogger(browser: puppeteer.Browser, logger: LevelLogger): Rx.Observable<void> {
|
getProcessLogger(browser: puppeteer.Browser, logger: LevelLogger): Rx.Observable<void> {
|
||||||
|
@ -266,21 +277,10 @@ export class HeadlessChromiumDriverFactory {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const uncaughtExceptionPageError$ = Rx.fromEvent<Error>(page, 'pageerror').pipe(
|
|
||||||
mergeMap((err) => {
|
|
||||||
return Rx.throwError(
|
|
||||||
i18n.translate('xpack.reporting.browsers.chromium.pageErrorDetected', {
|
|
||||||
defaultMessage: `Reporting encountered an error on the page: {err}`,
|
|
||||||
values: { err: err.toString() },
|
|
||||||
})
|
|
||||||
);
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const browserDisconnect$ = Rx.fromEvent(browser, 'disconnected').pipe(
|
const browserDisconnect$ = Rx.fromEvent(browser, 'disconnected').pipe(
|
||||||
mergeMap(() => Rx.throwError(getChromiumDisconnectedError()))
|
mergeMap(() => Rx.throwError(getChromiumDisconnectedError()))
|
||||||
);
|
);
|
||||||
|
|
||||||
return Rx.merge(pageError$, uncaughtExceptionPageError$, browserDisconnect$);
|
return Rx.merge(pageError$, browserDisconnect$);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue