Project

General

Profile

« Previous | Next » 

Revision 3349

sql.py: run_query(): ConstraintException: Get and include the constraint condition in the exception

View differences:

lib/sql.py
530 530
            if match:
531 531
                table, constraint = match.groups()
532 532
                constraint = sql_gen.Col(constraint, table)
533
                raise CheckException(constraint.to_str(db), None, [], e)
533
                cond = None
534
                if recover: # need auto-rollback to run constraint_cond()
535
                    try: cond = constraint_cond(db, constraint)
536
                    except NotImplementedError: pass
537
                raise CheckException(constraint.to_str(db), cond, [], e)
534 538
            
535 539
            match = re.match(r'^(?:invalid input (?:syntax|value)\b.*?'
536 540
                r'|.+? field value out of range): "(.+?)"', msg)

Also available in: Unified diff