guardian/facia-scala-client — pull request #4 by janua (2014-09-15 15:21:51+00:00)
Title: Better error handling

This changes `S3Client` to return a `FaciaResult` for `get`.

These different results are then handled accordingly by `ApiClient.retrieve`, or rather, not at all for the default implementation.

The `S3` `client` is weird. For any problems communicating with `S3`, it throws an `AmazonS3Exception`, which gives no information as to what has gone wrong, apart from the error string. (`NotFound` or `NotAuthorized`). This means that `FaciaNotFound` and `FaciaNotAuthorized` aren't used by the default client, and instead `FaciaUnknownError` is returned (For want of a better name).

I am leaving in `FaciaNotFound` and `FaciaNotAuthorized` so one can use the correct types for these errors if they are using their own client.

I am least happiest about `retrieve` method just throwing a `BackendError` for each of the cases, but I can't see why it would need to be any more complicated. A `Try[JsResult]` perhaps?

@robertberry @adamnfish