From 278628eaebba0e290fbaf91f0035a82d3c960cd8 Mon Sep 17 00:00:00 2001 From: sherzinger <sascha.herzinger@uni.lu> Date: Thu, 17 Jan 2019 13:47:02 +0100 Subject: [PATCH] Added message to the stack in custom errors --- frontend-js/src/main/js/SecurityError.js | 2 +- frontend-js/src/main/js/ValidationError.js | 2 +- frontend-js/src/main/js/gui/GuiMessageError.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend-js/src/main/js/SecurityError.js b/frontend-js/src/main/js/SecurityError.js index e388bd04d4..65ce6ae30d 100644 --- a/frontend-js/src/main/js/SecurityError.js +++ b/frontend-js/src/main/js/SecurityError.js @@ -12,7 +12,7 @@ var logger = require('./logger'); */ function SecurityError(message) { this.message = message; - this.stack = (new Error()).stack; + this.stack = (new Error(message)).stack; } SecurityError.prototype = Object.create(Error.prototype); diff --git a/frontend-js/src/main/js/ValidationError.js b/frontend-js/src/main/js/ValidationError.js index 2a1bec9469..080f957bed 100644 --- a/frontend-js/src/main/js/ValidationError.js +++ b/frontend-js/src/main/js/ValidationError.js @@ -12,7 +12,7 @@ var logger = require('./logger'); */ function ValidationError(message) { this.message = message; - this.stack = (new Error()).stack; + this.stack = (new Error(message)).stack; } ValidationError.prototype = Object.create(Error.prototype); diff --git a/frontend-js/src/main/js/gui/GuiMessageError.js b/frontend-js/src/main/js/gui/GuiMessageError.js index e978ff15b3..098c45d37b 100644 --- a/frontend-js/src/main/js/gui/GuiMessageError.js +++ b/frontend-js/src/main/js/gui/GuiMessageError.js @@ -12,7 +12,7 @@ var logger = require('../logger'); */ function GuiMessageError(message) { this.message = message; - this.stack = (new Error()).stack; + this.stack = (new Error(message)).stack; } GuiMessageError.prototype = Object.create(Error.prototype); -- GitLab