Skip to content

Commit

Permalink
fix: check if error exists before checking for message attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshah98 committed Oct 26, 2023
1 parent e39df90 commit 6e3e2ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export async function* withPage(percy, url, callback, retry) {
return yield* yieldTo(callback(page));
} catch (error) {
// if the page crashed and retry returns truthy, try again
if (error.message?.includes('crashed') && retry?.()) {
if (error?.message?.includes('crashed') && retry?.()) {
return yield* withPage(...arguments);
}

Expand Down

0 comments on commit 6e3e2ff

Please sign in to comment.