colomon/uri — pull request #1 by dagurval (2013-05-19 20:01:40+00:00)
Title: error on accessing scheme when it's missing

I got "no such method 'lc'" when fetching a site with LWP::Simple. I think it'd be nice to have a proper error message.

Before:

$ perl6 -MURI -e "URI.new(q{vg.no}).default_port"
No such method 'lc' for invocant of type 'Any'
in method scheme at lib/URI.pm:138
in method default_port at lib/URI.pm:150
in block at -e:1

After:

$ perl6 -MURI -e "URI.new(q{vg.no}).default_port"
URI is missing a scheme
in method scheme at /home/dagurval/dev/uri/lib/URI.pm:138
in method default_port at /home/dagurval/dev/uri/lib/URI.pm:152
in block at -e:1