My JSON webservice uses HTTP Status codes.
I know it's a novel idea to use internationally agreed upon standards (and hardly anyone does it...) but come on Firefox! WTF!? I thought standards are what you were all about!?
I send a bad password via xhr and my webservice responds 422 Unprocessable Entity with JSON which describes the error in greater detail.
Firefox turns that response into an empty string!!! But if the status code is 2xx it works fine. Huh? What? Huh?
jQuery 1.4 is set up to parse using window.JSON and As it turns out an empty string isn't proper JSON and an exception is thrown. WebApp go BOOM!
I'd like to submit a bug to Mozilla, but I have to wait for their mail system to get through to mine... and hence I decided to blog about it.
In the meantime... I guess I lie and use 200 status codes? I don't know. That seems to be the simplest solution.
Firefox, why don't you parse error messages?
Published 2010-1-18By AJ ONeal
Thanks!
It's really motivating to know that people like you are benefiting
from what I'm doing and want more of it. :)
Did I make your day?
Buy me a coffee
(you can learn about the bigger picture I'm working towards on my patreon page )