Bug 863548 - Validation errors in API are reported differently than other errors
Validation errors in API are reported differently than other errors
Status: NEW
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: aeolus-conductor (Show other bugs)
1.1.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Jiri Stransky
Rehana
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-05 14:50 EDT by Jiri Stransky
Modified: 2012-10-09 12:51 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jiri Stransky 2012-10-05 14:50:48 EDT
Description of problem:

Validation errors on API requests have a different response format from other errors (e.g. resource not found). We should consistently use one format for reporting API errors to client applications.
  
Actual results:

Validation errors are reported as

<errors>
  <error>
    <message>Catalog name has already been taken</message>
  </error>
</errors>


Expected results:

Validation errors should be reported as

<error>
  <code>ValidationError</code>
  <message>Catalog name has already been taken</message>
</error>
Comment 1 Jiri Stransky 2012-10-05 14:54:06 EDT
Solution posted as pull request:

https://github.com/aeolusproject/conductor/pull/104
Comment 3 Jiri Stransky 2012-10-09 12:51:51 EDT
It was concluded on IRC that we'll postpone this for now and fix it for v2 of the API (that should come with CF 2.0?). If we fixed it now, then API that was already published as part of CF 1.0 would be broken by the change.

Note You need to log in before you can comment on or make changes to this bug.