gengo/gengo-java — pull request #13 by hermanschaaf (2013-12-05 05:17:56+00:00)
Title: BUG-1126 Improve exception handling

Because this Java library sends an array of jobs to the Gengo API, in the case of an error the server responds with a JSON object like this:

```
{
"opstat": "error",
"err": {
"0": [
{
"code": 1551,
"msg": "language service not supported"
}
]
}
}
```

The "0" index there is not expected by this Java client, and this fix aims to improve that by handling both the case where a "0"-index with an array is returned (in which case it only throws the first error as an exception), and when the API responds with an error without any indexes or arrays.

This PR also adds a new test case to ensure that exception handling is done correctly for this case.