Even if it's not technically a regression against the specification as per Benjamin's message above, breaking working code is still not very good. Could you please report this on the OCaml bugtracker? http://caml.inria.fr/mantis/ On Sun, Sep 14, 2014 at 12:53 AM, Benjamin Greenman wrote: > Why do you match on the error string? String.sub is only documented to > raise "Invalid_argument _". > > http://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html > > On Sat, Sep 13, 2014 at 6:47 PM, Oliver Bandel > wrote: > >> Hello, >> >> is this a known bug? >> >> Needed to change code from >> >> with Invalid_argument("Strings.sub") >> to >> with Invalid_argument("Bytes.sub") >> >> The code now looks like this and then works again: >> >> >> try >> if parser_url_len > 0 && parser_url = String.sub url >> 0 parser_url_len then parser_name else aux tl >> with Invalid_argument("Bytes.sub") -> aux tl (* this >> happens if url is shorter than parser_url *) >> >> >> Ciao, >> Oliver >> >> >> -- >> Caml-list mailing list. Subscription management and archives: >> https://sympa.inria.fr/sympa/arc/caml-list >> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >> Bug reports: http://caml.inria.fr/bin/caml-bugs >> > >