make api error messages more readable
This commit is contained in:
@@ -304,7 +304,10 @@ class APIRequestHandler(tornado.web.RequestHandler):
|
||||
try:
|
||||
failure.raiseException()
|
||||
except exception.ApiError as ex:
|
||||
self._error(type(ex).__name__ + "." + ex.code, ex.message)
|
||||
if ex.code:
|
||||
self._error(ex.code, ex.message)
|
||||
else:
|
||||
self._error(type(ex).__name__, ex.message)
|
||||
# TODO(vish): do something more useful with unknown exceptions
|
||||
except Exception as ex:
|
||||
self._error(type(ex).__name__, str(ex))
|
||||
|
@@ -529,7 +529,7 @@ class CloudController(object):
|
||||
context.project.id, min_instances)
|
||||
raise QuotaError("Instance quota exceeded. You can only "
|
||||
"run %s more instances of this type." %
|
||||
num_instances)
|
||||
num_instances, "InstanceLimitExceeded")
|
||||
# make sure user can access the image
|
||||
# vpn image is private so it doesn't show up on lists
|
||||
vpn = kwargs['image_id'] == FLAGS.vpn_image_id
|
||||
|
Reference in New Issue
Block a user