[katello-devel] Introducing ApiError in the ApiController
Dmitri Dolguikh
dmitri at redhat.com
Thu Jul 28 12:39:50 UTC 2011
On 11-07-28 9:22 AM, Lukas Zapletal wrote:
> On 07/28/2011 12:40 PM, Dmitri Dolguikh wrote:
>>> That's all. If there are no objections I will update all the places.
>>>
>> definitely a good idea, Lukas.
>
> I fixed all (both) the places ;-)
>
> and also replaced all the BadRequest exceptions with this new
> ApiError. I think web app should respond with HTTP 500 for all
> application level exceptions. Bad request should be more used when
> invalid input is provided.
i disagree: i think in the case of rest api, we should rely more on http
status codes to provide more meaningful exceptions, otherwise the client
is forced to parse our textual error messages (which is less reliable,
language-locale dependent, etc). I'd say we should use 500 for all
internal issues (such as db is down, out of memory, etc), i.e. issues
where user is not at fault, and cannot do anything to correct the issue.
If corrective action by the user is possible, we should use an
appropriate http status code.
cheers,
-d
>
> b25aa02 introducing application error exception for API
>
> If the UI team is interested I can prepare the similar AppError
> exception also in the main app_controller.
>
More information about the katello-devel
mailing list