diff options
author | Cerberus <matt.dietz@rackspace.com> | 2011-04-22 10:39:35 -0500 |
---|---|---|
committer | Cerberus <matt.dietz@rackspace.com> | 2011-04-22 10:39:35 -0500 |
commit | c03e9805328afe1d03fa65ac93d2b91ba04c229e (patch) | |
tree | 7234fe551b9f6e32b80e91753dbf91a2181d4b9a /nova/exception.py | |
parent | 14718afef1cc79b4d41f490be677caf3e4191e2b (diff) | |
parent | 8af2a2d720b97ef17565d57a9b8b028d449a9c84 (diff) | |
download | nova-c03e9805328afe1d03fa65ac93d2b91ba04c229e.tar.gz nova-c03e9805328afe1d03fa65ac93d2b91ba04c229e.tar.xz nova-c03e9805328afe1d03fa65ac93d2b91ba04c229e.zip |
Merge from trunk
Diffstat (limited to 'nova/exception.py')
-rw-r--r-- | nova/exception.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/nova/exception.py b/nova/exception.py index 4e2bbdbaf..3123b2f1f 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -16,31 +16,34 @@ # License for the specific language governing permissions and limitations # under the License. -""" -Nova base exception handling, including decorator for re-raising -Nova-type exceptions. SHOULD include dedicated exception logging. +"""Nova base exception handling. + +Includes decorator for re-raising Nova-type exceptions. + +SHOULD include dedicated exception logging. + """ from nova import log as logging + + LOG = logging.getLogger('nova.exception') class ProcessExecutionError(IOError): - def __init__(self, stdout=None, stderr=None, exit_code=None, cmd=None, description=None): if description is None: - description = _("Unexpected error while running command.") + description = _('Unexpected error while running command.') if exit_code is None: exit_code = '-' - message = _("%(description)s\nCommand: %(cmd)s\n" - "Exit code: %(exit_code)s\nStdout: %(stdout)r\n" - "Stderr: %(stderr)r") % locals() + message = _('%(description)s\nCommand: %(cmd)s\n' + 'Exit code: %(exit_code)s\nStdout: %(stdout)r\n' + 'Stderr: %(stderr)r') % locals() IOError.__init__(self, message) class Error(Exception): - def __init__(self, message=None): super(Error, self).__init__(message) @@ -97,7 +100,7 @@ class TimeoutException(Error): class DBError(Error): - """Wraps an implementation specific exception""" + """Wraps an implementation specific exception.""" def __init__(self, inner_exception): self.inner_exception = inner_exception super(DBError, self).__init__(str(inner_exception)) @@ -108,7 +111,7 @@ def wrap_db_error(f): try: return f(*args, **kwargs) except Exception, e: - LOG.exception(_('DB exception wrapped')) + LOG.exception(_('DB exception wrapped.')) raise DBError(e) return _wrap _wrap.func_name = f.func_name |