postrank-labs / goliath

Goliath is a non-blocking Ruby web server framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does coerce still work?

markalanevans opened this issue · comments

I add this to my api.rb

use Goliath::Rack::Validation::CoerceValue, :key => 'url', :as => ValidUrl

And required this class /libs/valid_url.rb in my runner.rb.

class ValidUrl

  def coerce value, opts ={}
    raise Goliath::Rack::Validation::FailedCoerce.new([400, {}, "URL is invalid"])
  end
end

The exception is never thrown. Am I missing something else?