From 1b6c55a9a0b0365a6af346eb7472ba077f3243ce Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Thu, 10 Jul 2008 13:46:20 +0000 Subject: better err msg --- it_dbi.class | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/it_dbi.class b/it_dbi.class index aa88487..914a162 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -330,15 +330,15 @@ function _where($params = "", $link = null, $omit_where = false) */ function _fatal($text) { - $text .= ", server=" . $this->_p['server']; - - if ($this->_link && ($res = @mysql_fetch_row(mysql_query('select database()', $this->_link)))) # dont create extra errs - $text .= ", db=" . $res[0]; + $text = get_class($this).'::'.$text; if ($this->_link && ($errno = mysql_errno($this->_link)) && ($errstr = mysql_error($this->_link))) - $text .= ", error=$errno ($errstr)"; + $text = "\"$errstr\" in $text"; + + if ($this->_link && ($res = @mysql_fetch_row(mysql_query('select database()', $this->_link)))) # dont create extra errs + $text .= ", DB: " . $res[0]; - it::fatal(get_class($this).'::'.$text); + it::fatal($text . ", Server: " . $this->_p['server']); /* NOT REACHED */ } -- cgit v1.2.3