abronte/TriggerHelpers — pull request #9 by iangreenleaf (2013-07-25 22:19:16+00:00)
Title: AJAX error callbacks

One of the things missing from having the `request` module in full parity with forge is what gets passed to the error callback.

When no connection is available, browser returns something like this:

```
{ readyState=4, status=404, statusText="error"}
```

Forge returns something like this:

```
{"message":"Error opening connection for ajax request","type":"EXPECTED_FAILURE","subtype":null}
```

On a 4xx, browser has this:

```
{
readyState=4,
responseText="{\"response\":{\"status\":422},\"errors\":[{\"message\":\"Unknown symbols\"}]}",
responseJSON={...},
status=422
statusText="OK"
}
```

Forge has this:

```
{
"message":"HTTP response code indicates failed request: 422",
"type":"EXPECTED_FAILURE",
"subtype":null,
"statusCode":"422",
"content":"{\"response\":{\"status\":422},\"errors\":[{\"message\":\"Unknown symbols\"}]}"
}
```