On 02/01/2010 11:09 PM, Aurynn Shaw wrote: > > Yes, this is exactly the problem that Exceptable is designed to solve. > If you can give me an exact example of the constraint error, I can add > a check into Exceptable proper. >
Well I mostly rely on the Exception 23505 which is constraint violation. I have checked the Exceptable code but I am not sure how to proceed building my own exception class based on a regex pattern. AFAIK, need to check this, but I believe Postgres reports constraint violations with the constraint name in double quotes at the end of the string, for example: duplicate key value violates unique constraint "constraint_name" insert or update on table "table_name" violates foreign key constraint "constraint_name" So I guess the Constraint violations exceptions should match both the code 23505 and regex 'constraint "([a-z_0-9]+)"$', where the constraint name could be extracted as a property of the constraint exception? That way we can extend it into custom exceptions like I am doing now in PHP. Vlad -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
