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
-
Adam French July 16th, 2008 @ 02:00 AM
- → Title changed from 500 (expected a 404) when requesting a format the exceptions controller doesn't provide to 500 (expected a 406) when requesting a format the exceptions controller doesn't provide
wycats and I were talking about this....technically a 406 probably should have been provided, rather than a 404
-
Michael Klishin (antares) July 16th, 2008 @ 09:51 PM
- → State changed from new to open
-
Yehuda Katz (wycats) July 20th, 2008 @ 05:52 AM
This is a big deal. I'm going to take a look at it tomorrow.
-
Michael Klishin (antares) August 2nd, 2008 @ 06:39 PM
- → Milestone changed from to 0.9.5
-
Michael Klishin (antares) August 23rd, 2008 @ 10:56 PM
- → Milestone changed from 0.9.5 to 0.9.6
-
Michael Klishin (antares) September 9th, 2008 @ 02:19 AM
- → Milestone changed from 0.9.6 to 0.9.7
-
Michael Klishin (antares) September 14th, 2008 @ 02:00 AM
- → Milestone changed from 0.9.7 to 0.9.9
-
-
Michael Klishin (antares) September 14th, 2008 @ 05:13 AM
The reason is 0.9.8 is gonna have two last big merges before 1.0. I want it to be fixed but now sure we can fit it into 0.9.8, that's why it is for 0.9.9. Makes sense?
-
Yehuda Katz (wycats) September 14th, 2008 @ 05:16 AM
@afrench it just turns out to be pretty tricky. I'll try and take care of it this week.
-
Michael Klishin (antares) October 7th, 2008 @ 12:02 PM
- → Tag changed from documentation exception-handling merb-core to documentation "exception-handling" "merb-core"
- → Milestone changed from 0.9.9 to 1.0 Final
-
Yehuda Katz (wycats) November 7th, 2008 @ 04:52 AM
- → Tag changed from documentation "exception-handling" "merb-core" to documentation exception-handling merb-core sprint triage
- → Milestone changed from 1.0 Final to 1.1
- → State changed from open to unconfirmed
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 »
