Skip to content

Commit 2f880d3

Browse files
committed
Fix stack trace on custom ParserError
1 parent 76ce13a commit 2f880d3

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

lib/ical/parse.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,8 @@ parse.component = function(str) {
9393
* @extends {Error}
9494
* @class
9595
*/
96-
9796
class ParserError extends Error {
98-
constructor(message) {
99-
super(message);
100-
this.name = this.constructor.name;
101-
102-
try {
103-
throw new Error();
104-
} catch (e) {
105-
if (e.stack) {
106-
let split = e.stack.split('\n');
107-
split.shift();
108-
this.stack = split.join('\n');
109-
}
110-
}
111-
}
97+
name = this.constructor.name;
11298
}
11399

114100
// classes & constants

0 commit comments

Comments
 (0)