Skip to content

Commit 090dd10

Browse files
authored
fix: Make sure that error is present before logging it in Vue (#3183)
1 parent 5054078 commit 090dd10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/integrations/src/vue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export class Vue implements Integration {
426426

427427
if (this._options.logErrors) {
428428
if (this._options.Vue.util) {
429-
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
429+
this._options.Vue.util.warn(`Error in ${info}: "${error && error.toString()}"`, vm);
430430
}
431431
// eslint-disable-next-line no-console
432432
console.error(error);

packages/vue/src/sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ class VueHelper {
396396

397397
if (this._options.logErrors) {
398398
if (this._options.Vue.util) {
399-
this._options.Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm);
399+
this._options.Vue.util.warn(`Error in ${info}: "${error && error.toString()}"`, vm);
400400
}
401401
// eslint-disable-next-line no-console
402402
console.error(error);

0 commit comments

Comments
 (0)