Skip to content

Commit

Permalink
Fix stack trace on custom ParserError
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Apr 15, 2024
1 parent 560cff3 commit d22ce47
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions lib/ical/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d22ce47

Please sign in to comment.