Project

General

Profile

« Previous | Next » 

Revision 4103

sql.py: run_query(): Exception handling: Fixed bug where PostgreSQL 9.1 PL/Python errors have a different format than PostgreSQL 9.0 which needs to be supported separately. This format was already supported in sql_gen.plpythonu_error_handler, but also needed to be supported for exceptions that propagate back to the client.

View differences:

lib/sql.py
512 512
            else: return run() # don't need savepoint if cached
513 513
        except Exception, e:
514 514
            msg = strings.ustr(e.args[0])
515
            msg = re.sub(r'^PL/Python: \w+: ', r'', msg)
515
            msg = re.sub(r'^(?:PL/Python: )?ValueError: ', r'', msg)
516 516
            
517 517
            match = re.match(r'^duplicate key value violates unique constraint '
518 518
                r'"(.+?)"', msg)

Also available in: Unified diff