From: hickert Date: Tue, 6 Apr 2010 08:32:21 +0000 (+0000) Subject: Added more detailed error messages X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1b71f3b8ba4d3ed2b6eed03c233305d9a0298d23;p=gosa.git Added more detailed error messages git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@17478 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc index 817b7aead..64c36bf49 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc @@ -211,7 +211,12 @@ class macro extends plugin @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_current)); - return ( msgPool::dbquery("GOfon",@mysql_error($r_current),$Server['SERVER'])); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,"".$query."", "ERROR"); + trigger_error(mysql_error($r_current)); + return( + sprintf( + _("Macro could not be removed from server '%s', please check database consistency!"), + $Server['SERVER'])); } @mysql_close($r_current); } @@ -273,12 +278,20 @@ class macro extends plugin */ $tmp = explode(",", $s_linestr,3); + // No priority given ... somehow + if(count($tmp) == 2){ + $tmp = array($tmp[0],"1",$tmp[1]); + } + /* Check if there is an application given */ - if(empty($tmp[1])){ + if($tmp[2] == ""){ return(sprintf(_("Application missing in line %s!"),$i_linenum)); } + if($tmp[1] == ""){ + return(sprintf(_("Priority missing in line %s!"),$i_linenum)); + } /* Check if there is an extension given */ - if(empty($tmp[0])){ + if($tmp[0] == ""){ return(sprintf(_("Extension missing in line %s!"),$i_linenum)); } @@ -308,6 +321,12 @@ class macro extends plugin @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,$query, "Database query"); if(!$res){ new log("debug","gofonmacro/".get_class($this),"",array(),@mysql_error($r_con)); + @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__,"".$query."", "ERROR"); + trigger_error(mysql_error($r_con)); + return( + sprintf( + _("Macro could not be added to server '%s', please check database consistency!"), + $cfg['SERVER'])); } @mysql_close($r_con); }