From d22ce4714e66f0c30687bbfc53e79457adcc9e20 Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Mon, 15 Apr 2024 12:04:10 +0200 Subject: [PATCH] Fix stack trace on custom ParserError --- lib/ical/parse.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/ical/parse.js b/lib/ical/parse.js index e0b7dfa1..aff4446f 100644 --- a/lib/ical/parse.js +++ b/lib/ical/parse.js @@ -93,22 +93,8 @@ parse.component = function(str) { * @extends {Error} * @class */ - class ParserError extends Error { - constructor(message) { - super(message); - this.name = this.constructor.name; - - try { - throw new Error(); - } catch (e) { - if (e.stack) { - let split = e.stack.split('\n'); - split.shift(); - this.stack = split.join('\n'); - } - } - } + name = this.constructor.name; } // classes & constants