solidusjs/solidus-client — pull request #3 by joanniclaborde (2014-11-05 15:58:12+00:00)
Title: Handle resource 404s

See https://github.com/solidusjs/solidus/issues/117

If a resource has a valid status code (<300), its content will be checked for errors. If it has a `status=error` property, the status code will be changed to 500. If it also has a property that indicates a "not found" error, the status code will be changed to 404 instead of 500.

Properties checked for "not found" error: `messages`, `error`, `message`, `response`, `body`
Regex used to check for "not found" error: `/(404|not ?found|not ?find|no ?\w+? ?found|invalid ?\w+|unknown ?\w+|do(es)? ?not ?exist)/i`

Note: this branch is based on #1