fluidinfo/fluidinfo.js — Issue #69: A /values query that gets a 404 calls onSuccess and results in a JS error
Author: terrycojones
Created: 2012-02-12 02:40:05+00:00
State: open

If I do the following query:

```
$ curl -v 'http://fluiddb.fluidinfo.com/values?tag=fluiddb%2Fabout&query=has%20terrycojones/9801'
```

I get a 404 because there is no such tag (`terrycojones/9801`). This causes an error in fluidinfo.js
`Uncaught TypeError: Cannot read property 'id' of undefined` at line 528:

```
var processResult = function(raw) {
var result = [];
var data = raw.data.results;
var objectID;
for (objectID in data.id){
```

because `raw` in an HTTP error object:

```
Object
data: ""
headers: Object
rawData: ""
request: XMLHttpRequest
status: 404
statusText: "Not Found"
__proto__: Object
```

The `options.onError` function should have been called, not the `onSuccess`.