[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Use of error codes in REST API responses



The console and the RHC client use them to specifically detect certain errors.  We would be happier if we got back a symbol/string representing a condition we can detect (things like "domain_not_found", "jenkins_cartridge_cant_connect_to_jenkins" etc).

https://github.com/openshift/rhc/blob/6af35c30aa3bd31f761dc3789c7ea70a00736963/lib/rhc/commands/app.rb#L471
https://github.com/openshift/rhc/blob/7d198583add7279277d8abb1a2e9d6e3359859b8/lib/rhc/rest/client.rb#L515

Console also maps exceptions, an example here: 

https://github.com/openshift/origin-server/blob/8daa5c2e2186d0d62c3d54ede1809d018546adce/console/app/models/domain.rb#L10

----- Original Message -----
> I'd like to open a discussion on whether we can remove error codes from the
> REST API responses.  The error codes are a carry over from the legacy API.
> It is my opinion that they are no longer needed in the REST API.  The
> combination of HTTP status code and error message should be sufficient for
> the REST clients.  I would be interested to know if any clients are using
> them, how and why?
> 
> Thanks,
> Lili
> 
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]