[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3793] branches/1.3/LedgerSMB.pm



Revision: 3793
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3793&view=rev
Author:   einhverfr
Date:     2011-10-03 00:20:50 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
Correcting bug 3415320, patch submitted by Herman Vierendeels

Modified Paths:
--------------
    branches/1.3/LedgerSMB.pm

Modified: branches/1.3/LedgerSMB.pm
===================================================================
--- branches/1.3/LedgerSMB.pm	2011-10-03 00:17:29 UTC (rev 3792)
+++ branches/1.3/LedgerSMB.pm	2011-10-03 00:20:50 UTC (rev 3793)
@@ -1007,18 +1007,21 @@
 
 sub dberror{
    my $self = shift @_;
-   my $state_error = {
-        '42883' => $self->{_locale}->text('Internal Database Error'),
-	'42501' => $self->{_locale}->text('Access Denied'),
-	'42401' => $self->{_locale}->text('Access Denied'),
-	'22008' => $self->{_locale}->text('Invalid date/time entered'),
-	'22012' => $self->{_locale}->text('Division by 0 error'),
-	'22004' => $self->{_locale}->text('Required input not provided'),
-	'23502' => $self->{_locale}->text('Required input not provided'),
-    '23505' => $self->{_locale}->text('Conflict with Existing Data'),
-	'P0001' => $self->{_locale}->text('Error from Function:') . "\n" .
+   my $state_error = {};
+   if ($self->{_locale}){
+       my $state_error = {
+            '42883' => $self->{_locale}->text('Internal Database Error'),
+            '42501' => $self->{_locale}->text('Access Denied'),
+            '42401' => $self->{_locale}->text('Access Denied'),
+            '22008' => $self->{_locale}->text('Invalid date/time entered'),
+            '22012' => $self->{_locale}->text('Division by 0 error'),
+            '22004' => $self->{_locale}->text('Required input not provided'),
+            '23502' => $self->{_locale}->text('Required input not provided'),
+            '23505' => $self->{_locale}->text('Conflict with Existing Data'),
+            'P0001' => $self->{_locale}->text('Error from Function:') . "\n" .
                     $self->{dbh}->errstr,
-   };
+       };
+   }
    $logger->error("Logging SQL State ".$self->{dbh}->state.", error ".
            $self->{dbh}->err . ", string " .$self->{dbh}->errstr);
    if (defined $state_error->{$self->{dbh}->state}){

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.