Skip to content

Commit 0c0a39a

Browse files
authored
Merge pull request #584 from gemini-testing/TESTPLANE-163.handle_error_with_snippet
fix: do not fail when extend error with snippet
2 parents 0bbf550 + d6ff05f commit 0c0a39a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/common-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ const cloneError = <T extends Error>(error: T): T => {
331331
};
332332

333333
export const mergeSnippetIntoErrorStack = <T extends Error>(error: T & { snippet?: string }): T => {
334-
if (!error.snippet) {
334+
if (!error || !error.snippet) {
335335
return error;
336336
}
337337

0 commit comments

Comments
 (0)