Skip to content

Commit 3863dca

Browse files
committed
Keep original stack trace for exceeded repetition errors.
1 parent 4e00a43 commit 3863dca

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tracker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ Tracker.prototype.reset = function () {
4545
this.stack[0].count = 0;
4646
}
4747

48-
/* eslint-disable complexity */
49-
5048
/**
5149
* Match a segment to the message table and update the current
5250
* position of the tracker.
@@ -74,7 +72,7 @@ Tracker.prototype.accept = function (segment) {
7472
// Check if the current position is not a group.
7573
if (content.constructor === String) {
7674
if (pointer.repetition() === pointer.count && content === segment) {
77-
error = new Error(`Segment ${segment} was repeated too much`);
75+
error.message = `Segment ${segment} was repeated too much`;
7876
}
7977
}
8078

@@ -85,6 +83,8 @@ Tracker.prototype.accept = function (segment) {
8583
return result;
8684
}
8785

86+
/* eslint-disable complexity */
87+
8888
Tracker.prototype.process = function (segment, metadata) {
8989
var current = this.stack[this.stack.length - 1];
9090
var optionals = [];

0 commit comments

Comments
 (0)