Project

General

Profile

« Previous | Next » 

Revision 7112

sql.py: Added InvalidTypeException and parse it in parse_exception()

View differences:

lib/sql.py
82 82

  
83 83
class InvalidValueException(ExceptionWithValue): pass
84 84

  
85
class InvalidTypeException(ExceptionWithNameType): pass
86

  
85 87
class DuplicateException(ExceptionWithNameType): pass
86 88

  
87 89
class DoesNotExistException(ExceptionWithNameType): pass
......
591 593
        type0, type1 = match.groups()
592 594
        raise MissingCastException(type0, None, e)
593 595
    
596
    match = re.match(r'^.*?\brelation "(.+?)" is not a (table)', msg)
597
    if match:
598
        name, type_ = match.groups()
599
        raise InvalidTypeException(type_, name, e)
600
    
594 601
    typed_name_re = r'^(\S+) "?(.+?)"?(?: of relation ".+?")?'
595 602
    
596 603
    match = re.match(typed_name_re+r'.*? already exists', msg)

Also available in: Unified diff