RusticiSoftware / TinCanJS

JavaScript library for the Experience API (Tin Can API)
http://rusticisoftware.github.io/TinCanJS/
Apache License 2.0
207 stars 115 forks source link

400 Fake status for XDR triggers error popup on missing state #53

Closed brianjmiller closed 10 years ago

brianjmiller commented 11 years ago

The fake status used for XDR is 400 which prevents the ignore404 configuration value for document APIs, in particular State, from preventing the popup error message when it should. XDR doesn't provide a proper way to get the real returned status for .onerror .

brianjmiller commented 11 years ago

The primary driver of this was the alert() messages showing up on documents when those documents weren't found because they've never previously been populated, which isn't an error just a 404 status code which gets eaten by the 400 fake status. Originally I was thinking that we could just switch the 400 to a 404 and everyone would be happy, but then that gives us no way to detect real errors in the case where we want to generally ignore 404s. So we are stuck with keeping the generic 400 error and instead it will have to be up to the user to determine whether a call that has 404d for real but has a fake 400 status is actually a 404 that can safely be ignored or is a real problem. But that leaves us with the alert message, so I've decided it is time for them to just go since I never particularly liked them anyways. A PR will be opened shortly once #52 is merged.

brianjmiller commented 10 years ago

Fixed by #54