Skip to content

Commit

Permalink
fix: Make sure that error is present before logging it in Vue (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek authored Jan 21, 2021
1 parent 5054078 commit 090dd10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/integrations/src/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ export class Vue implements Integration {

if (this._options.logErrors) {
if (this._options.Vue.util) {
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
this._options.Vue.util.warn(`Error in ${info}: "${error && error.toString()}"`, vm);
}
// eslint-disable-next-line no-console
console.error(error);
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class VueHelper {

if (this._options.logErrors) {
if (this._options.Vue.util) {
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
this._options.Vue.util.warn(`Error in ${info}: "${error && error.toString()}"`, vm);
}
// eslint-disable-next-line no-console
console.error(error);
Expand Down

0 comments on commit 090dd10

Please sign in to comment.