Project

General

Profile

« Previous | Next » 

Revision 5764

sql.py: parse_exception(): Parse "could not create unique index ... Key is duplicated" errors as DuplicateKeyException

View differences:

lib/sql.py
525 525
        constraint, = match.groups()
526 526
        raise make_DuplicateKeyException(constraint, e)
527 527
    
528
    match = re.match(r'^could not create unique index "(.+?)"\n'
529
        r'DETAIL:  Key .+? is duplicated', msg)
530
    if match:
531
        constraint, = match.groups()
532
        raise make_DuplicateKeyException(constraint, e)
533
    
528 534
    match = re.match(r'^null value in column "(.+?)" violates not-null'
529 535
        r' constraint', msg)
530 536
    if match:

Also available in: Unified diff