[katello-devel] Error Responses And Subscription Manager

Devan Goodwin dgoodwin at rm-rf.ca
Wed Jul 6 15:33:38 UTC 2011


On Wed, Jul 6, 2011 at 12:21 PM, Dmitri Dolguikh <dmitri at redhat.com> wrote:
> On 11-07-06 11:56 AM, Devan Goodwin wrote:
>
> While working on Katello environment registration we hit an issue
> where subscription-manager expects the response to contain json when
> something goes wrong, something like this:
>
> {
>   "displayMessage" : "Invalid Credentials"
> }%
>
> Katello however is just returning text in the body like this:
>
> "Organization ACME_Corporation has 'locker' environment only. Please
> create an environment for system registration."
>
> Can we standardize on this "displayMessage" packed in JSON format?
> Alternatively I could try just display the response body if we get an
> error and cannot parse JSON from it.
>
> Thoughts?
>
> Thanks,
>
> Devan
>
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel
>
> I think that we should return errors the same way Active Resource does:
> https://engineering.redhat.com/trac/kalpana/wiki/ActiveResourceErrorParsing.
> That would allow for showing more localized (in terms of model fields) error
> messages.
>
> -d
>

Works for me, we could very easily look for 'errors' as well as
'displayMessage' and even change Candlepin to do the same.




More information about the katello-devel mailing list