diff options
author | Urban Müller | 2008-07-10 13:46:20 +0000 |
---|---|---|
committer | Urban Müller | 2008-07-10 13:46:20 +0000 |
commit | 1b6c55a9a0b0365a6af346eb7472ba077f3243ce (patch) | |
tree | 05f8c042bc4694a4a48a264bd7b987c887d49454 /it_dbi.class | |
parent | 1eb87694ab5e1bd77bd9d6c7ab72e188fd5843df (diff) | |
download | itools-1b6c55a9a0b0365a6af346eb7472ba077f3243ce.tar.gz itools-1b6c55a9a0b0365a6af346eb7472ba077f3243ce.tar.bz2 itools-1b6c55a9a0b0365a6af346eb7472ba077f3243ce.zip |
better err msg
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 12 |
1 files 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 */ } |