strongloop/strong-remoting — pull request #145 by STRML (2014-12-08 09:58:38+00:00)
Title: Don't crash on improperly formatted inputs. Introduced in #131 and fixes #144.

This is critical IMO as servers deployed with strong-remoting `2.10.0` and not using domains will crash on any invalid input.

This PR properly restores the previous behavior of calling back with an error when presented with invalid input, and also properly sets a `400` status and a helpful error message.

When invoking a function with an improperly formatted object (`test`), for example, rather than the message (which was the behavior before the merging of #131 - now you just get a crash):

```
{
"error": {
"message": "SyntaxError: Unexpected token t",
}
}
```

One will now see something like:

```
{
"error": {
"message": "invalid value for argument 'filter' of type 'object': test",
"status": 400
}
}
```