diff --git a/Layer-5__DB_operation/PostgreSQL.php b/Layer-5__DB_operation/PostgreSQL.php index 66caf9d..f3b54f3 100644 --- a/Layer-5__DB_operation/PostgreSQL.php +++ b/Layer-5__DB_operation/PostgreSQL.php @@ -52,7 +52,16 @@ class PostgreSQL // Check for query error if (strlen ($r=pg_last_error ($GLOBALS["PG_CONNECT"]))) { - $error = "ERROR:
 {$sqlQuery} 
{$r}"; // DEBUG + if ( preg_match("/^.*out of range.*$/",$r) ) // PostgreSQL error codes ERRCODE_*_VALUE_OUT_OF_RANGE + { + // Error message to show to webapp users + $error = "

".gettext('Value out of range.')."

". + "

".gettext('Please, try again.')."

"; + } + else + { + $error = "ERROR:
 {$sqlQuery} 
{$r}"; // DEBUG + } // $error = "$r"; // No DEBUG throw new Exception($error,true); }