Skip to content

Commit

Permalink
Added additional check before adding the ._error property (#1657)
Browse files Browse the repository at this point in the history
* Update error.js

* fix: error.js formatting

Co-authored-by: Alex Sokolov <4497128+Alex-Sokolov@users.noreply.github.com>
  • Loading branch information
Alex-Sokolov and Alex-Sokolov committed Aug 21, 2020
1 parent fadddc2 commit 8e9dda3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/test-utils/src/error.js
Expand Up @@ -5,7 +5,10 @@ function errorHandler(errorOrString, vm) {
const error =
typeof errorOrString === 'object' ? errorOrString : new Error(errorOrString)

vm._error = error
if (vm) {
vm._error = error
}

throw error
}

Expand Down

0 comments on commit 8e9dda3

Please sign in to comment.