Skip to content

Commit 8dec92b

Browse files
committed
improved error logging
1 parent 9beab9c commit 8dec92b

File tree

1 file changed

+5
-3
lines changed
  • bin/accessibility-automation/cypress

1 file changed

+5
-3
lines changed

bin/accessibility-automation/cypress/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,11 @@ commandToOverwrite.forEach((command) => {
318318

319319
afterEach(() => {
320320
try {
321-
throw new Error("Deliberate error for debugging purposes");
322-
} catch (err) {
323-
browserStackLog("Deliberate error caught:", err.stack);
321+
throw new Error('Deliberate exception thrown for testing purposes');
322+
} catch (error) {
323+
if (error && error.stack) {
324+
browserStackLog(error.stack);
325+
}
324326
}
325327
const attributes = Cypress.mocha.getRunner().suite.ctx.currentTest;
326328
cy.window().then(async (win) => {

0 commit comments

Comments
 (0)