#402 unconfirmed
Adam French

500 (expected a 406) when requesting a format the exceptions controller doesn't provide

Reported by Adam French | July 16th, 2008 @ 01:54 AM | in 1.1

So, basically if you were to have a controller like:

class Stories < Merb::Controller
  provides :html, :xml

  def index; 'woo'; end
end

and requested the valid route for it but with an invalid format, like

http://localhost:4000/index.fjtm

The exceptions controller kicks in, but if Exceptions doesn't 'provide' :fjtm, it'll throw a 500.

So, the easy way around this is to `provides :all` in your Exceptions controller and then handle content_types in a CASE statement with an ELSE.

If this is the right way to handle it, then the generated default Exceptions controller should have `provides :all` with some sample CASE statements.

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »