joshbuddy / http_router

A kick-ass HTTP router for use in Rack
MIT License
198 stars 44 forks source link

More descriptive exceptions for HttpRouter#url #24

Open postmodern opened 12 years ago

postmodern commented 12 years ago

HttpRouter#url needs to raise more descriptive exceptions, when required url params are not specified:

r.url(:my_test_path)
HttpRouter::InvalidRouteException: HttpRouter::InvalidRouteException
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router/route.rb:144:in `block in url_with_params'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router/route.rb:153:in `url_args_processing'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router/route.rb:142:in `url_with_params'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router/route.rb:133:in `url'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router.rb:154:in `block in url'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router.rb:154:in `each'
    /home/hal/.rvm/gems/ruby-1.9.3-p0/gems/http_router-0.10.2/lib/http_router.rb:154:in `url'