launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #07376
Re: Breaking backward incompatibility with exception mapping
On Thu, Jun 16, 2011 at 10:05 AM, Francis J. Lacoste
<francis.lacoste@xxxxxxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> We have a bunch of exceptions that are mapped to 400 but should really
> be mapped to 404. NoSuchPPA, NoSuchDistroSeries, NoSuchBranch, etc.
>
> Fixing that is trivial, but we don't have a way of saying: if this
> exception occurs when the webservice is using that service, use that
> code, otherwise use that other code. We could probably add that
> functionality, but is it worth it?
>
> Changing this would break error handling logic that relied on catching
> BadRequest to handle not found cases. Given that BadRequest is not
> overly specific, it would make sense to confirm the error through the
> string in that case, but I don't know if clients did this.
Code catching BadRequest and treating that as 'no such object' is
broken - it will handle things wrong /anyway/ - so I would be happy
with you just changing to issue 404's.
-Rob
References