Skip to content

Commit 946d173

Browse files
authored
Show problematic url
1 parent f4f51b7 commit 946d173

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ function* lexer(str: string): Generator<LexToken, LexToken> {
145145
}
146146

147147
if (pos) {
148-
throw new TypeError(`Unterminated quote at ${pos}: ${DEBUG_URL}`);
148+
throw new TypeError(`Unterminated quote at ${pos}: ${str}; Visit ${DEBUG_URL} for more information.`);
149149
}
150150
}
151151

152152
if (!value) {
153-
throw new TypeError(`Missing parameter name at ${i}: ${DEBUG_URL}`);
153+
throw new TypeError(`Missing parameter name at ${i}: ${str}; Visit ${DEBUG_URL} for more information.`);
154154
}
155155

156156
return value;
@@ -203,7 +203,7 @@ class Iter {
203203
if (value !== undefined) return value;
204204
const { type: nextType, index } = this.peek();
205205
throw new TypeError(
206-
`Unexpected ${nextType} at ${index}, expected ${type}: ${DEBUG_URL}`,
206+
`Unexpected ${nextType} at ${index}, expected ${type}: ${str}; Visit ${DEBUG_URL} for more information.`,
207207
);
208208
}
209209

@@ -575,7 +575,7 @@ function toRegExp(tokens: Flattened[], delimiter: string, keys: Keys) {
575575

576576
if (token.type === "param" || token.type === "wildcard") {
577577
if (!isSafeSegmentParam && !backtrack) {
578-
throw new TypeError(`Missing text after "${token.name}": ${DEBUG_URL}`);
578+
throw new TypeError(`Missing text after "${token.name}": ${str}; Visit ${DEBUG_URL} for more information.`);
579579
}
580580

581581
if (token.type === "param") {

0 commit comments

Comments
 (0)