Merge "Return 409 status instead of 500 if package exists"

This commit is contained in:
Jenkins 2015-03-02 14:07:19 +00:00 committed by Gerrit Code Review
commit cfa4f8ae92
3 changed files with 13 additions and 1 deletions

View File

@ -42,6 +42,7 @@ General information
* 403 ``Forbidden`` - access denied.
* 404 ``Not Found`` - resource was not found
* 405 ``Method Not Allowed`` - requested method is not supported for resource.
* 409 ``Conflict`` - requested method resulted in a conflict with the current state of the resource.
* **Response of POSTs and PUTs**

View File

@ -641,6 +641,17 @@ Created application returned
}
}
+----------------+-----------------------------------------------------------+
| Code | Description |
+================+===========================================================+
| 200 | Deployments information received successfully |
+----------------+-----------------------------------------------------------+
| 400 | Application package was considered invalid |
+----------------+-----------------------------------------------------------+
| 409 | Package with specified FQPN already exists |
+----------------+-----------------------------------------------------------+
Delete application from environment
-----------------------------------

View File

@ -234,7 +234,7 @@ class Controller(object):
except db_exc.DBDuplicateEntry:
msg = _('Package with specified full name is already registered')
LOG.exception(msg)
raise exc.HTTPServerError(msg)
raise exc.HTTPConflict(msg)
return package.to_dict()
def get_ui(self, req, package_id):