strongloop/loopback-datasource-juggler — pull request #135 by albertoleal (2014-06-11 20:05:00+00:00)
Title: ConvertNulltoNotFoundError when calling DataAccessObject.findOne via rest

When we call the url `http://localhost:3000/api/cars/1` with an invalid id we get a 404 error:

```javascript
{
error: {
name: "Error",
status: 404,
message: "Unknown "cars" id "1".",
statusCode: 404,
stack: "Error: Unknown "cars" id 1". at Function...
}
}
```

But, when I try to use filters, such as `http://localhost:3000/api/cars/findOne?filter%5Bwhere%5D%5Bid%5D=1`, I have another behavior:

```javascript
null
```

This PR follows the same approach found in: https://github.com/strongloop/loopback-datasource-juggler/blob/master/lib/dao.js#L364-L371