betfair / cougar

Cougar is a framework for making building network exposed service interfaces easy.
http://betfair.github.io/cougar
Apache License 2.0
27 stars 18 forks source link

Don't pass through all cougar-client errors to service transport #10

Closed eswdd closed 10 years ago

eswdd commented 10 years ago

The issue was that Cougar was returning the error code from a server dependency as the error code from the server rather than an internal error.

The chain: Client -> Server -> ServerDependency

Responses: Client gets NotFound <- Server gets NotFound <- ServerDepenedency returns NotFound

What would be nice: Client gets InternalError <- Server gets NotFound <- ServerDependency returns NotFound And the Server logs the response it gets from its dependency

eswdd commented 10 years ago

As per the closing comments in #8, this work should dispose of DSC-0026 and instead provide contextual info for a receiver of an exception from the client to indicate that the exception may not have come from a cougar server. This should be in the message as well as being a property of the exception.

eswdd commented 10 years ago

Suggestion is to add a new base cougar exception: CougarClientException, which gets handled differently to a CougarServiceException or CougarFrameworkException. The base CougarClientException would then contain the necessary contextual info.

eswdd commented 10 years ago

DSC-0026 seems sane to keep to represent generic unrecognised/unhandled response from server, although will add the contextual info too..

eswdd commented 10 years ago

Still need to print the new info in the new exceptions when print them..