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

Sensible client error when receive HTTP 413 #8

Open eswdd opened 10 years ago

eswdd commented 10 years ago

we would like cougar client to be modified to return a sensible error when it receives an HTTP 413 (HEAD full) error from Jetty.

At the moment it returns: DSC-0026, Server is NOT identified as a Cougar 2 Server

This error can be simulated by passing a very long URI Rescript request

eswdd commented 10 years ago

Originally raised by @stottpaul

eswdd commented 10 years ago

I've been looking at a simple fix for this - namely to send back some identifying info about the server when Jetty sends a 413 or a 414, and it's not easy.

And it makes me wonder whether we should clean-up the DSC-0026 error which always felt like a bit of a hash job. What it's trying to do is give the client programmer some info that says - this error didn't appear to come from a Cougar, but likely from some intermediate network device, be it a load balancer or something else.

In reality - the other end not being a cougar is not an error, people put network devices in the path for all sorts of good reasons. Some contextual info for a receiver of an exception from the client seems valid, throwing an error because we think it wasn't a cougar sending us the message - not so good.

So, I'm going to close this as a won't fix, and commute the requirement to #10 to implement in a cleaner way. It means DSC-0026 is likely to become a legacy error code.

eswdd commented 10 years ago

This shouldn't be closed, as we will fix it. But it will go on the back burner until #10 is completed. A test to check this functionality is partially implemented in ClientExcessivelyLongStringQueryParamTest.java