<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 11-07-06 12:33 PM, Devan Goodwin wrote:
    <blockquote
cite="mid:CAE0EtNEYz_U+dATyTsqbfuV-VzBKUibMwU4fvQ9JcbFpD8LmNQ@mail.gmail.com"
      type="cite">
      <pre wrap="">On Wed, Jul 6, 2011 at 12:21 PM, Dmitri Dolguikh <a class="moz-txt-link-rfc2396E" href="mailto:dmitri@redhat.com"><dmitri@redhat.com></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">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
<a class="moz-txt-link-abbreviated" href="mailto:katello-devel@redhat.com">katello-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/katello-devel">https://www.redhat.com/mailman/listinfo/katello-devel</a>

I think that we should return errors the same way Active Resource does:
<a class="moz-txt-link-freetext" href="https://engineering.redhat.com/trac/kalpana/wiki/ActiveResourceErrorParsing">https://engineering.redhat.com/trac/kalpana/wiki/ActiveResourceErrorParsing</a>.
That would allow for showing more localized (in terms of model fields) error
messages.

-d

</pre>
      </blockquote>
      <pre wrap="">
Works for me, we could very easily look for 'errors' as well as
'displayMessage' and even change Candlepin to do the same.
</pre>
    </blockquote>
    <font face="Arial">Are you working on this now? I'll work on
      supporting this then...<br>
      -d<br>
    </font>
  </body>
</html>