Skip to content

Commit 665aed4

Browse files
committed
Report failing position if parsing failed
1 parent 9889c73 commit 665aed4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/io/vertx/uritemplate/impl/UriTemplateImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ public static class Parser {
318318

319319
public UriTemplateImpl parseURITemplate(String s) {
320320
template = new UriTemplateImpl();
321-
if (parseURITemplate(s, 0) != s.length()) {
322-
throw new IllegalArgumentException();
321+
int stop = parseURITemplate(s, 0);
322+
if (stop != s.length()) {
323+
throw new IllegalArgumentException("Error parsing template at position: " + stop);
323324
}
324325
for (Term term : template.terms) {
325326
if (term instanceof Expression && ((Expression) term).operator == Operator.FUTURE) {

0 commit comments

Comments
 (0)