fix: resolve TS2345 in pageerror handler by using unknown and type guard
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 5s
🚀 Build & Deploy / 🧪 QA (push) Successful in 1m53s
🚀 Build & Deploy / 🏗️ Build (push) Successful in 11m58s
🚀 Build & Deploy / 🚀 Deploy (push) Successful in 11s
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m27s
🚀 Build & Deploy / 🔔 Notify (push) Successful in 2s
Nightly QA / call-qa-workflow (push) Failing after 26s
Some checks failed
🚀 Build & Deploy / 🔍 Prepare (push) Successful in 5s
🚀 Build & Deploy / 🧪 QA (push) Successful in 1m53s
🚀 Build & Deploy / 🏗️ Build (push) Successful in 11m58s
🚀 Build & Deploy / 🚀 Deploy (push) Successful in 11s
🚀 Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 3m27s
🚀 Build & Deploy / 🔔 Notify (push) Successful in 2s
Nightly QA / call-qa-workflow (push) Failing after 26s
This commit is contained in:
@@ -79,10 +79,11 @@ async function main() {
|
|||||||
const consoleErrorsList: Array<{ type: string; error: string; page: string }> = [];
|
const consoleErrorsList: Array<{ type: string; error: string; page: string }> = [];
|
||||||
|
|
||||||
// Listen for unhandled exceptions natively in the page
|
// Listen for unhandled exceptions natively in the page
|
||||||
page.on('pageerror', (err: Error) => {
|
page.on('pageerror', (err: unknown) => {
|
||||||
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
||||||
consoleErrorsList.push({
|
consoleErrorsList.push({
|
||||||
type: 'PAGE_ERROR',
|
type: 'PAGE_ERROR',
|
||||||
error: err.message,
|
error: errorMessage,
|
||||||
page: page.url(),
|
page: page.url(),
|
||||||
});
|
});
|
||||||
hasConsoleErrors = true;
|
hasConsoleErrors = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user