Ignore:
Timestamp:
Nov 11, 2008, 3:50:12 AM (15 years ago)
Author:
broder
Message:

Move CodeError? and InvalidInput? into invirt.common

Location:
trunk/packages/invirt-base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-base/debian/changelog

    r1609 r1612  
     1invirt-base (0.0.9) unstable; urgency=low
     2
     3  * Move useful Python exceptions into invirt.common
     4
     5 -- Evan Broder <broder@mit.edu>  Tue, 11 Nov 2008 00:32:19 -0500
     6
    17invirt-base (0.0.8) unstable; urgency=low
    28
  • trunk/packages/invirt-base/python/invirt/common.py

    r1330 r1612  
    3838
    3939#
     40# Exceptions.
     41#
     42
     43class InvalidInput(Exception):
     44    """Exception for user-provided input is invalid but maybe in good faith.
     45
     46    This would include setting memory to negative (which might be a
     47    typo) but not setting an invalid boot CD (which requires bypassing
     48    the select box).
     49    """
     50    def __init__(self, err_field, err_value, expl=None):
     51        MyException.__init__(self, expl)
     52        self.err_field = err_field
     53        self.err_value = err_value
     54
     55class CodeError(Exception):
     56    """Exception for internal errors or bad faith input."""
     57    pass
     58
     59#
    4060# Tests.
    4161#
Note: See TracChangeset for help on using the changeset viewer.