Re: proposal: codify a common set of error codes + request/response headers for all services

1 view
Skip to first unread message

Richard Newman

unread,
Mar 15, 2012, 4:53:41 PM3/15/12
to rke...@mozilla.com, tell...@mozilla.com, servic...@mozilla.org
I think I asked for client upgrade required. Idea is to have an unambiguous early response saying "you're blocked for being TOO OLD", with an actionable state for the client. Doesn't have to have meaningful content, so long as the response is unambiguous.


-----Original Message-----
From: Toby Elliott [tell...@mozilla.com]
Received: Thursday, 15 Mar 2012, 1:46pm
To: Ryan Kelly [rke...@mozilla.com]
CC: servic...@mozilla.org
Subject: Re: proposal: codify a common set of error codes + request/response headers for all services

On Mar 15, 2012, at 1:33 PM, Ryan Kelly wrote:

> On 15/03/12 13:25, Toby Elliott wrote:
>
>> I would look to get rid of the response code list entirely. The vast majority of those response codes are very old-sync specific. Several have been replaced by better http status codes, several are things we don't care about any more, and several are really specific things that we threw in there later because there was nowhere better to put them at the time.
>>
>> I went through them a while back and I think there were maybe 3 left after we filtered out everything that was being handled better elsewhere. For the few 400-block responses remaining, I'd rather see a brief JSON blob more akin to an exception (generic type and specific details) rather than arbitrary numbers. They're supposed to be pretty rare at this point.
>
> The remaining 400-Bad-Request cases I can think of are things like "badly-formed JSON", "invalid header value", and "client upgrade required".
>
> One could argue that there's not much a machine could do with these errors, since they indicate serious implementation problems. So more human-friendly output might be better.

Badly-formed JSON and invalid headers are 400s, and adding a code for those specific problems seems not terribly useful. Someone who actually has the power to fix this (which is basically the developer) will want a response with more details. For everyone else, it doesn't matter.

I'm not actually sure how we plan to use "client upgrade required" (it's not in the code anywhere), but my best guess is that would just be a 415.

Toby

_______________________________________________
Services-dev mailing list
Servic...@mozilla.org
https://mail.mozilla.org/listinfo/services-dev

Toby Elliott

unread,
Mar 15, 2012, 4:55:09 PM3/15/12
to Richard Newman, servic...@mozilla.org

On Mar 15, 2012, at 1:53 PM, Richard Newman wrote:

> I think I asked for client upgrade required. Idea is to have an unambiguous early response saying "you're blocked for being TOO OLD", with an actionable state for the client. Doesn't have to have meaningful content, so long as the response is unambiguous.
>

Yeah, sounds right. I'm not yet sure how we'd identify this, so I'm afraid of making any definitive pronouncements around this at this point, but 415 seems like one way to go.

Reply all
Reply to author
Forward
0 new messages