Project

General

Profile

« Previous | Next » 

Revision 3419

sql.py: Added DoesNotExistException and parse it in run_query()

View differences:

lib/sql.py
82 82

  
83 83
class DuplicateException(ExceptionWithNameType): pass
84 84

  
85
class DoesNotExistException(ExceptionWithNameType): pass
86

  
85 87
class EmptyRowException(DbException): pass
86 88

  
87 89
##### Warnings
......
549 551
                col, type_ = match.groups()
550 552
                raise MissingCastException(type_, col, e)
551 553
            
552
            match = re.match(r'^(\S+) "(.+?)".*? already exists', msg)
554
            typed_name_re = r'^(\S+) "(.+?)"'
555
            
556
            match = re.match(typed_name_re+r'.*? already exists', msg)
553 557
            if match:
554 558
                type_, name = match.groups()
555 559
                raise DuplicateException(type_, name, e)
556 560
            
561
            match = re.match(typed_name_re+r' does not exist', msg)
562
            if match:
563
                type_, name = match.groups()
564
                raise DoesNotExistException(type_, name, e)
565
            
557 566
            raise # no specific exception raised
558 567
    except log_ignore_excs:
559 568
        log_level += 2

Also available in: Unified diff