Changeset 247

Show
Ignore:
Timestamp:
02/10/07 00:35:18 (2 years ago)
Author:
mikey
Message:

bugfix: create correct chain if cause is another instance of net.stubbles.stubChainedException

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/stubChainedException.php

    r168 r247  
    7373        $string  = substr($parentString, 0, strlen($parentString) - 1); 
    7474        $string .= ' caused by '; 
    75         if ($this->cause instanceof stubException) { 
    76             $string .= $this->cause->getClassName(); 
     75        if ($this->cause instanceof stubChainedException) { 
     76            $string .= $this->cause->__toString(); 
    7777        } else { 
    78             $string .= get_class($this->cause); 
     78            if ($this->cause instanceof stubException) { 
     79                $string .= $this->cause->getClassName(); 
     80            } else { 
     81                $string .= get_class($this->cause); 
     82            } 
     83             
     84            $string .= " {\n    message(string): " . $this->cause->getMessage() . "\n"; 
     85            $string .= '    file(string): ' . $this->cause->getFile() . "\n"; 
     86            $string .= '    line(integer): ' . $this->cause->getLine() . "\n"; 
     87            $string .= '    code(integer): ' . $this->cause->getCode() . "\n"; 
     88            $string .= "}\n"; 
    7989        } 
    8090         
    81         $string .= " {\n    message(string): " . $this->cause->getMessage() . "\n"; 
    82         $string .= '    file(string): ' . $this->cause->getFile() . "\n"; 
    83         $string .= '    line(integer): ' . $this->cause->getLine() . "\n"; 
    84         $string .= '    code(integer): ' . $this->cause->getCode() . "\n"; 
    85         $string .= "}\n"; 
    8691        return $string; 
    8792    }