domkm / silk

Routing for Clojure & ClojureScript
222 stars 13 forks source link

silk/composite throws an exception when unable to match #1

Closed pokle closed 9 years ago

pokle commented 9 years ago

This matches:

(silk/match (silk/composite ["pre" (silk/integer :i) "post"]) "pre5post")
; => {:i 5}

But this throws a NumberFormatException (diff: extra letter 'c' after the 5)

(silk/match (silk/composite ["pre" (silk/integer :i) "post"]) "pre5cpost")
; => NumberFormatException For input string: "5c"  java.lang.NumberFormatException.forInputString (NumberFormatException.java:65)

But I expect it to return nil

domkm commented 9 years ago

Thanks for the report! I'll get that fixed today.

pokle commented 9 years ago

Cheers!