summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-01-27 10:48:00 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2011-01-27 10:48:00 -0800
commit9c35a9a32dc58cb56685292a7ba056f95e715474 (patch)
treedccebe86085158333659b46e0469106c0dd9b22d /nova/exception.py
parent0a6ab4362284d92cddd22ee6bfa4182c64299064 (diff)
downloadnova-9c35a9a32dc58cb56685292a7ba056f95e715474.tar.gz
nova-9c35a9a32dc58cb56685292a7ba056f95e715474.tar.xz
nova-9c35a9a32dc58cb56685292a7ba056f95e715474.zip
Fixes NotFound messages in api to show the ec2_id.
Added InstanceNotFound and VolumeNotFound errors to store internal id. Removed redundant method instance_get_by_id. Caught exceptions in api layer and fixed messages to use ec2_id.
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/nova/exception.py b/nova/exception.py
index f604fd63a..7d65bd6a5 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -46,7 +46,6 @@ class Error(Exception):
class ApiError(Error):
-
def __init__(self, message='Unknown', code='Unknown'):
self.message = message
self.code = code
@@ -57,6 +56,18 @@ class NotFound(Error):
pass
+class InstanceNotFound(NotFound):
+ def __init__(self, message, instance_id):
+ self.instance_id = instance_id
+ super(InstanceNotFound, self).__init__(message)
+
+
+class VolumeNotFound(NotFound):
+ def __init__(self, message, volume_id):
+ self.volume_id = volume_id
+ super(VolumeNotFound, self).__init__(message)
+
+
class Duplicate(Error):
pass