Skip to content

Commit

Permalink
Merge pull request #584 from gemini-testing/TESTPLANE-163.handle_erro…
Browse files Browse the repository at this point in the history
…r_with_snippet

fix: do not fail when extend error with snippet
  • Loading branch information
DudaGod authored Aug 1, 2024
2 parents 0bbf550 + d6ff05f commit 0c0a39a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/common-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const cloneError = <T extends Error>(error: T): T => {
};

export const mergeSnippetIntoErrorStack = <T extends Error>(error: T & { snippet?: string }): T => {
if (!error.snippet) {
if (!error || !error.snippet) {
return error;
}

Expand Down

0 comments on commit 0c0a39a

Please sign in to comment.