Skip to content
Browse files

Make the Pg error regex more resistant to localization. I hope!

  • Loading branch information...
1 parent 070f5ce commit fc831a3871def21c6ffe70d238564a743c738950 @theory theory committed Jun 21, 2006
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Bric/Biz/Asset/Business.pm
View
4 lib/Bric/Biz/Asset/Business.pm
@@ -2679,10 +2679,10 @@ sub _update_uris {
rethrow_exception($err)
# Check for PostgreSQL 7.4 error message.
unless $err->get_payload =~
- /duplicate key violates unique constraint "udx_$key\_uri__site_id__uri"/
+ /violates unique[\s-]constraint\s[^\[]udx_$key\_uri__site_id__uri/i
# Check for PostgreSQL 7.3, 7.2, or 7.1 error message.
or $err->get_payload =~
- /Cannot insert a duplicate key into unique index udx_$key\_uri__site_id__uri/;
+ /Cannot insert a duplicate key into unique index udx_$key\_uri__site_id__uri/i;
my $things = $key eq 'media'
? 'category, or file name'
: 'slug, or categories';

0 comments on commit fc831a3

Please sign in to comment.
Something went wrong with that request. Please try again.