summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-28 10:23:54 +0000
committerGerrit Code Review <review@openstack.org>2013-03-28 10:23:54 +0000
commit039951f5b63c1040d9d04a9ea9fd34abda8bf152 (patch)
tree5367a2376596b7a78e31abb9fd5685482ca29a09
parent921b3dcaad908f35ee2366d45cc67a13919bb2e1 (diff)
parentff4e9a2c325fbe622b40219587d7ac3cc39b51df (diff)
downloadnova-039951f5b63c1040d9d04a9ea9fd34abda8bf152.tar.gz
Merge "Use format_message on exceptions instead of str()" into milestone-proposed
-rw-r--r--nova/api/openstack/compute/contrib/admin_actions.py2
-rw-r--r--nova/api/openstack/compute/contrib/agents.py4
-rw-r--r--nova/api/openstack/compute/contrib/console_output.py2
-rw-r--r--nova/api/openstack/compute/contrib/consoles.py6
-rw-r--r--nova/api/openstack/compute/contrib/deferred_delete.py4
-rw-r--r--nova/api/openstack/compute/contrib/fixed_ips.py2
-rw-r--r--nova/api/openstack/compute/contrib/flavor_access.py4
-rw-r--r--nova/api/openstack/compute/contrib/flavorextraspecs.py4
-rw-r--r--nova/api/openstack/compute/contrib/flavormanage.py4
-rw-r--r--nova/api/openstack/compute/contrib/floating_ip_dns.py4
-rw-r--r--nova/api/openstack/compute/contrib/floating_ips_bulk.py6
-rw-r--r--nova/api/openstack/compute/contrib/hosts.py8
-rw-r--r--nova/api/openstack/compute/contrib/rescue.py3
-rw-r--r--nova/api/openstack/compute/contrib/security_groups.py8
-rw-r--r--nova/api/openstack/compute/contrib/server_password.py2
-rw-r--r--nova/api/openstack/compute/contrib/server_start_stop.py4
-rw-r--r--nova/api/openstack/compute/server_metadata.py10
-rw-r--r--nova/api/openstack/compute/servers.py32
-rw-r--r--nova/compute/api.py2
19 files changed, 59 insertions, 52 deletions
diff --git a/nova/api/openstack/compute/contrib/admin_actions.py b/nova/api/openstack/compute/contrib/admin_actions.py
index 951bc0c113..ff595fad6d 100644
--- a/nova/api/openstack/compute/contrib/admin_actions.py
+++ b/nova/api/openstack/compute/contrib/admin_actions.py
@@ -286,7 +286,7 @@ class AdminActionsController(wsgi.Controller):
exception.InvalidHypervisorType,
exception.UnableToMigrateToSelf,
exception.DestinationHypervisorTooOld) as ex:
- raise exc.HTTPBadRequest(explanation=str(ex))
+ raise exc.HTTPBadRequest(explanation=ex.format_message())
except Exception:
if host is None:
msg = _("Live migration of instance %(id)s to another host"
diff --git a/nova/api/openstack/compute/contrib/agents.py b/nova/api/openstack/compute/contrib/agents.py
index 1ea92b4dec..7756187f33 100644
--- a/nova/api/openstack/compute/contrib/agents.py
+++ b/nova/api/openstack/compute/contrib/agents.py
@@ -109,7 +109,7 @@ class AgentController(object):
'url': url,
'md5hash': md5hash})
except exception.AgentBuildNotFound as ex:
- raise webob.exc.HTTPNotFound(explanation=str(ex))
+ raise webob.exc.HTTPNotFound(explanation=ex.format_message())
return {"agent": {'agent_id': id, 'version': version,
'url': url, 'md5hash': md5hash}}
@@ -122,7 +122,7 @@ class AgentController(object):
try:
db.agent_build_destroy(context, id)
except exception.AgentBuildNotFound as ex:
- raise webob.exc.HTTPNotFound(explanation=str(ex))
+ raise webob.exc.HTTPNotFound(explanation=ex.format_message())
def create(self, req, body):
"""Creates a new agent build."""
diff --git a/nova/api/openstack/compute/contrib/console_output.py b/nova/api/openstack/compute/contrib/console_output.py
index 2cfa6e4476..b3588d3446 100644
--- a/nova/api/openstack/compute/contrib/console_output.py
+++ b/nova/api/openstack/compute/contrib/console_output.py
@@ -66,7 +66,7 @@ class ConsoleOutputController(wsgi.Controller):
except exception.NotFound:
raise webob.exc.HTTPNotFound(_('Unable to get console'))
except exception.InstanceNotReady as e:
- raise webob.exc.HTTPConflict(explanation=unicode(e))
+ raise webob.exc.HTTPConflict(explanation=e.format_message())
# XML output is not correctly escaped, so remove invalid characters
remove_re = re.compile('[\x00-\x08\x0B-\x0C\x0E-\x1F-\x0D]')
diff --git a/nova/api/openstack/compute/contrib/consoles.py b/nova/api/openstack/compute/contrib/consoles.py
index 0431a06945..ade5261b24 100644
--- a/nova/api/openstack/compute/contrib/consoles.py
+++ b/nova/api/openstack/compute/contrib/consoles.py
@@ -47,7 +47,7 @@ class ConsolesController(wsgi.Controller):
instance,
console_type)
except exception.InstanceNotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
except exception.InstanceNotReady as e:
raise webob.exc.HTTPConflict(
explanation=_('Instance not yet ready'))
@@ -69,9 +69,9 @@ class ConsolesController(wsgi.Controller):
instance,
console_type)
except exception.InstanceNotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
except exception.InstanceNotReady as e:
- raise webob.exc.HTTPConflict(explanation=unicode(e))
+ raise webob.exc.HTTPConflict(explanation=e.format_message())
return {'console': {'type': console_type, 'url': output['url']}}
diff --git a/nova/api/openstack/compute/contrib/deferred_delete.py b/nova/api/openstack/compute/contrib/deferred_delete.py
index 122fc70353..30358b3761 100644
--- a/nova/api/openstack/compute/contrib/deferred_delete.py
+++ b/nova/api/openstack/compute/contrib/deferred_delete.py
@@ -44,8 +44,8 @@ class DeferredDeleteController(wsgi.Controller):
self.compute_api.restore(context, instance)
except exception.QuotaError as error:
raise webob.exc.HTTPRequestEntityTooLarge(
- explanation=unicode(error),
- headers={'Retry-After': 0})
+ explanation=error.format_message(),
+ headers={'Retry-After': 0})
except exception.InstanceInvalidState as state_error:
common.raise_http_conflict_for_instance_invalid_state(state_error,
'restore')
diff --git a/nova/api/openstack/compute/contrib/fixed_ips.py b/nova/api/openstack/compute/contrib/fixed_ips.py
index 6f0a36888b..e88038f3ff 100644
--- a/nova/api/openstack/compute/contrib/fixed_ips.py
+++ b/nova/api/openstack/compute/contrib/fixed_ips.py
@@ -34,7 +34,7 @@ class FixedIPController(object):
try:
fixed_ip = db.fixed_ip_get_by_address_detailed(context, id)
except exception.FixedIpNotFoundForAddress as ex:
- raise webob.exc.HTTPNotFound(explanation=str(ex))
+ raise webob.exc.HTTPNotFound(explanation=ex.format_message())
fixed_ip_info = {"fixed_ip": {}}
if fixed_ip[1] is None:
diff --git a/nova/api/openstack/compute/contrib/flavor_access.py b/nova/api/openstack/compute/contrib/flavor_access.py
index ec5937094f..39220ee4af 100644
--- a/nova/api/openstack/compute/contrib/flavor_access.py
+++ b/nova/api/openstack/compute/contrib/flavor_access.py
@@ -175,7 +175,7 @@ class FlavorActionController(wsgi.Controller):
try:
instance_types.add_instance_type_access(id, tenant, context)
except exception.FlavorAccessExists as err:
- raise webob.exc.HTTPConflict(explanation=str(err))
+ raise webob.exc.HTTPConflict(explanation=err.format_message())
return _marshall_flavor_access(id)
@@ -192,7 +192,7 @@ class FlavorActionController(wsgi.Controller):
try:
instance_types.remove_instance_type_access(id, tenant, context)
except exception.FlavorAccessNotFound, e:
- raise webob.exc.HTTPNotFound(explanation=str(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
return _marshall_flavor_access(id)
diff --git a/nova/api/openstack/compute/contrib/flavorextraspecs.py b/nova/api/openstack/compute/contrib/flavorextraspecs.py
index 1349abe78c..de68eb7d6e 100644
--- a/nova/api/openstack/compute/contrib/flavorextraspecs.py
+++ b/nova/api/openstack/compute/contrib/flavorextraspecs.py
@@ -76,7 +76,7 @@ class FlavorExtraSpecsController(object):
flavor_id,
specs)
except exception.MetadataLimitExceeded as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
return body
@wsgi.serializers(xml=ExtraSpecTemplate)
@@ -95,7 +95,7 @@ class FlavorExtraSpecsController(object):
flavor_id,
body)
except exception.MetadataLimitExceeded as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
return body
@wsgi.serializers(xml=ExtraSpecTemplate)
diff --git a/nova/api/openstack/compute/contrib/flavormanage.py b/nova/api/openstack/compute/contrib/flavormanage.py
index e8ac4d522a..7cff7f4b89 100644
--- a/nova/api/openstack/compute/contrib/flavormanage.py
+++ b/nova/api/openstack/compute/contrib/flavormanage.py
@@ -45,7 +45,7 @@ class FlavorManageController(wsgi.Controller):
flavor = instance_types.get_instance_type_by_flavor_id(
id, read_deleted="no")
except exception.NotFound, e:
- raise webob.exc.HTTPNotFound(explanation=str(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
instance_types.destroy(flavor['name'])
@@ -75,7 +75,7 @@ class FlavorManageController(wsgi.Controller):
req.cache_db_flavor(flavor)
except (exception.InstanceTypeExists,
exception.InstanceTypeIdExists) as err:
- raise webob.exc.HTTPConflict(explanation=str(err))
+ raise webob.exc.HTTPConflict(explanation=err.format_message())
return self._view_builder.show(req, flavor)
diff --git a/nova/api/openstack/compute/contrib/floating_ip_dns.py b/nova/api/openstack/compute/contrib/floating_ip_dns.py
index 5caea9ffaa..62eb0d08f9 100644
--- a/nova/api/openstack/compute/contrib/floating_ip_dns.py
+++ b/nova/api/openstack/compute/contrib/floating_ip_dns.py
@@ -189,7 +189,7 @@ class FloatingIPDNSDomainController(object):
try:
self.network_api.delete_dns_domain(context, domain)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
return webob.Response(status_int=202)
@@ -274,7 +274,7 @@ class FloatingIPDNSEntryController(object):
try:
self.network_api.delete_dns_entry(context, name, domain)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
return webob.Response(status_int=202)
diff --git a/nova/api/openstack/compute/contrib/floating_ips_bulk.py b/nova/api/openstack/compute/contrib/floating_ips_bulk.py
index e6a7fecee5..1baf474c23 100644
--- a/nova/api/openstack/compute/contrib/floating_ips_bulk.py
+++ b/nova/api/openstack/compute/contrib/floating_ips_bulk.py
@@ -98,12 +98,12 @@ class FloatingIPBulkController(object):
'interface': interface}
for address in self._address_to_hosts(ip_range))
except exception.InvalidInput as exc:
- raise webob.exc.HTTPBadRequest(explanation=str(exc))
+ raise webob.exc.HTTPBadRequest(explanation=exc.format_message())
try:
db.floating_ip_bulk_create(context, ips)
except exception.FloatingIpExists as exc:
- raise webob.exc.HTTPBadRequest(explanation=str(exc))
+ raise webob.exc.HTTPBadRequest(explanation=exc.format_message())
return {"floating_ips_bulk_create": {"ip_range": ip_range,
"pool": pool,
@@ -126,7 +126,7 @@ class FloatingIPBulkController(object):
ips = ({'address': str(address)}
for address in self._address_to_hosts(ip_range))
except exception.InvalidInput as exc:
- raise webob.exc.HTTPBadRequest(explanation=str(exc))
+ raise webob.exc.HTTPBadRequest(explanation=exc.format_message())
db.floating_ip_bulk_destroy(context, ips)
return {"floating_ips_bulk_delete": ip_range}
diff --git a/nova/api/openstack/compute/contrib/hosts.py b/nova/api/openstack/compute/contrib/hosts.py
index 925ded7365..373974d7be 100644
--- a/nova/api/openstack/compute/contrib/hosts.py
+++ b/nova/api/openstack/compute/contrib/hosts.py
@@ -195,7 +195,7 @@ class HostController(object):
msg = _("Virt driver does not implement host maintenance mode.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
if result not in ("on_maintenance", "off_maintenance"):
raise webob.exc.HTTPBadRequest(explanation=result)
return result
@@ -215,7 +215,7 @@ class HostController(object):
msg = _("Virt driver does not implement host disabled status.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
if result not in ("enabled", "disabled"):
raise webob.exc.HTTPBadRequest(explanation=result)
return result
@@ -231,7 +231,7 @@ class HostController(object):
msg = _("Virt driver does not implement host power management.")
raise webob.exc.HTTPNotImplemented(explanation=msg)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
return {"host": host_name, "power_action": result}
@wsgi.serializers(xml=HostActionTemplate)
@@ -312,7 +312,7 @@ class HostController(object):
try:
service = self.api.service_get_by_compute_host(context, host_name)
except exception.NotFound as e:
- raise webob.exc.HTTPNotFound(explanation=unicode(e))
+ raise webob.exc.HTTPNotFound(explanation=e.format_message())
except exception.AdminRequired:
msg = _("Describe-resource is admin only functionality")
raise webob.exc.HTTPForbidden(explanation=msg)
diff --git a/nova/api/openstack/compute/contrib/rescue.py b/nova/api/openstack/compute/contrib/rescue.py
index d8699e0e05..87d838bdfd 100644
--- a/nova/api/openstack/compute/contrib/rescue.py
+++ b/nova/api/openstack/compute/contrib/rescue.py
@@ -64,7 +64,8 @@ class RescueController(wsgi.Controller):
common.raise_http_conflict_for_instance_invalid_state(state_error,
'rescue')
except exception.InstanceNotRescuable as non_rescuable:
- raise exc.HTTPBadRequest(explanation=unicode(non_rescuable))
+ raise exc.HTTPBadRequest(
+ explanation=non_rescuable.format_message())
return {'adminPass': password}
diff --git a/nova/api/openstack/compute/contrib/security_groups.py b/nova/api/openstack/compute/contrib/security_groups.py
index 615bf97649..354fab647f 100644
--- a/nova/api/openstack/compute/contrib/security_groups.py
+++ b/nova/api/openstack/compute/contrib/security_groups.py
@@ -387,7 +387,7 @@ class ServerSecurityGroupController(SecurityGroupControllerBase):
try:
instance = self.compute_api.get(context, server_id)
except exception.InstanceNotFound as exp:
- raise exc.HTTPNotFound(explanation=unicode(exp))
+ raise exc.HTTPNotFound(explanation=exp.format_message())
groups = self.security_group_api.get_instance_security_groups(
req, instance['id'], instance['uuid'], True)
@@ -429,11 +429,11 @@ class SecurityGroupActionController(wsgi.Controller):
instance = self.compute_api.get(context, id)
method(context, instance, group_name)
except exception.SecurityGroupNotFound as exp:
- raise exc.HTTPNotFound(explanation=unicode(exp))
+ raise exc.HTTPNotFound(explanation=exp.format_message())
except exception.InstanceNotFound as exp:
- raise exc.HTTPNotFound(explanation=unicode(exp))
+ raise exc.HTTPNotFound(explanation=exp.format_message())
except exception.Invalid as exp:
- raise exc.HTTPBadRequest(explanation=unicode(exp))
+ raise exc.HTTPBadRequest(explanation=exp.format_message())
return webob.Response(status_int=202)
diff --git a/nova/api/openstack/compute/contrib/server_password.py b/nova/api/openstack/compute/contrib/server_password.py
index 9436d354fe..14ea91ef22 100644
--- a/nova/api/openstack/compute/contrib/server_password.py
+++ b/nova/api/openstack/compute/contrib/server_password.py
@@ -47,7 +47,7 @@ class ServerPasswordController(object):
try:
return self.compute_api.get(context, server_id)
except exception.InstanceNotFound as exp:
- raise webob.exc.HTTPNotFound(explanation=unicode(exp))
+ raise webob.exc.HTTPNotFound(explanation=exp.format_message())
@wsgi.serializers(xml=ServerPasswordTemplate)
def index(self, req, server_id):
diff --git a/nova/api/openstack/compute/contrib/server_start_stop.py b/nova/api/openstack/compute/contrib/server_start_stop.py
index a13aabb05c..c4d0d5c9ef 100644
--- a/nova/api/openstack/compute/contrib/server_start_stop.py
+++ b/nova/api/openstack/compute/contrib/server_start_stop.py
@@ -47,7 +47,7 @@ class ServerStartStopActionController(wsgi.Controller):
try:
self.compute_api.start(context, instance)
except exception.InstanceNotReady as e:
- raise webob.exc.HTTPConflict(explanation=unicode(e))
+ raise webob.exc.HTTPConflict(explanation=e.format_message())
return webob.Response(status_int=202)
@wsgi.action('os-stop')
@@ -59,7 +59,7 @@ class ServerStartStopActionController(wsgi.Controller):
try:
self.compute_api.stop(context, instance)
except exception.InstanceNotReady as e:
- raise webob.exc.HTTPConflict(explanation=unicode(e))
+ raise webob.exc.HTTPConflict(explanation=e.format_message())
return webob.Response(status_int=202)
diff --git a/nova/api/openstack/compute/server_metadata.py b/nova/api/openstack/compute/server_metadata.py
index 7dc6b0194e..3f7915a845 100644
--- a/nova/api/openstack/compute/server_metadata.py
+++ b/nova/api/openstack/compute/server_metadata.py
@@ -127,14 +127,16 @@ class Controller(object):
raise exc.HTTPBadRequest(explanation=msg)
except exception.InvalidMetadata as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.InvalidMetadataSize as error:
- raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error))
+ raise exc.HTTPRequestEntityTooLarge(
+ explanation=error.format_message())
except exception.QuotaError as error:
- raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error),
- headers={'Retry-After': 0})
+ raise exc.HTTPRequestEntityTooLarge(
+ explanation=error.format_message(),
+ headers={'Retry-After': 0})
except exception.InstanceInvalidState as state_error:
common.raise_http_conflict_for_instance_invalid_state(state_error,
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index df8055b625..12efa5eb47 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -897,25 +897,27 @@ class Controller(wsgi.Controller):
auto_disk_config=auto_disk_config,
scheduler_hints=scheduler_hints)
except exception.QuotaError as error:
- raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error),
- headers={'Retry-After': 0})
+ raise exc.HTTPRequestEntityTooLarge(
+ explanation=error.format_message(),
+ headers={'Retry-After': 0})
except exception.InstanceTypeMemoryTooSmall as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.InstanceTypeNotFound as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error)
except exception.InstanceTypeDiskTooSmall as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.InvalidMetadata as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.InvalidMetadataSize as error:
- raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error))
+ raise exc.HTTPRequestEntityTooLarge(
+ explanation=error.format_message())
except exception.InvalidRequest as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.ImageNotFound as error:
msg = _("Can not find requested image")
raise exc.HTTPBadRequest(explanation=msg)
except exception.ImageNotActive as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.FlavorNotFound as error:
msg = _("Invalid flavorRef provided.")
raise exc.HTTPBadRequest(explanation=msg)
@@ -923,7 +925,7 @@ class Controller(wsgi.Controller):
msg = _("Invalid key_name provided.")
raise exc.HTTPBadRequest(explanation=msg)
except exception.SecurityGroupNotFound as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except rpc_common.RemoteError as err:
msg = "%(err_type)s: %(err_msg)s" % {'err_type': err.exc_type,
'err_msg': err.value}
@@ -1288,16 +1290,18 @@ class Controller(wsgi.Controller):
msg = _("Instance could not be found")
raise exc.HTTPNotFound(explanation=msg)
except exception.InvalidMetadata as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(
+ explanation=error.format_message())
except exception.InvalidMetadataSize as error:
- raise exc.HTTPRequestEntityTooLarge(explanation=unicode(error))
+ raise exc.HTTPRequestEntityTooLarge(
+ explanation=error.format_message())
except exception.ImageNotFound:
msg = _("Cannot find image for rebuild")
raise exc.HTTPBadRequest(explanation=msg)
except exception.InstanceTypeMemoryTooSmall as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
except exception.InstanceTypeDiskTooSmall as error:
- raise exc.HTTPBadRequest(explanation=unicode(error))
+ raise exc.HTTPBadRequest(explanation=error.format_message())
instance = self._get_server(context, req, id)
diff --git a/nova/compute/api.py b/nova/compute/api.py
index e3d48d6767..1046b54271 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -2894,7 +2894,7 @@ class SecurityGroupAPI(base.Base, security_group_base.SecurityGroupBase):
return self.db.security_group_get(context, id)
except exception.NotFound as exp:
if map_exception:
- msg = unicode(exp)
+ msg = exp.format_message()
self.raise_not_found(msg)
else:
raise