Best way to remove the trace information from the PDOException __toString method

lijoveliyath

New Member
Is it possible to remove the trace elements from the __toString.What I want is something like this.\[code\]class DBException extends PDOException{public function __toString(){ return get_class($this) . " '{$this->getMessage()}' in {$this->getFile()}({$this->getLine()})\n";}}\[/code\]I've tried the above method but it doesn't seem to work. Any ideas?If I use a try catch block below as example, I still get the trace data.\[code\]try {// Do something here}catch(DBException $e) { echo $e;}\[/code\]I would have thought that echoing $e would trigger the __toString method in my DBException class.
 
Back
Top