Changeset 888

Show
Ignore:
Timestamp:
08/31/07 18:24:59 (11 months ago)
Author:
mikey
Message:

replaced some exceptions with better suited exceptions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessor.php

    r884 r888  
    304304        $binder = stubRegistry::get('net.stubbles.ioc.stubBinder'); 
    305305        if (($binder instanceof stubBinder) === false) { 
    306             throw new stubException('No instance of net.stubbles.ioc.stubBinder in registry.'); 
     306            throw new stubRuntimeException('No instance of net.stubbles.ioc.stubBinder in registry.'); 
    307307        } 
    308308         
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisIncludeFilePageElement.php

    r818 r888  
    77 * @subpackage  websites_memphis 
    88 */ 
    9 stubClassLoader::load('net.stubbles.util.stubRegistry', 
     9stubClassLoader::load('net.stubbles.lang.exceptions.stubIOException', 
     10                      'net.stubbles.util.stubRegistry', 
    1011                      'net.stubbles.websites.memphis.stubMemphisPageElement' 
    1112); 
     
    6263     * processes the page element 
    6364     * 
    64      * @param   stubRequest    $request   the request data 
    65      * @param   stubSession    $session   current session 
    66      * @param   stubResponse   $response  contains response data 
    67      * @param   array          $context   optional  additional context data 
    68      * @throws  stubException 
     65     * @param   stubRequest      $request   the request data 
     66     * @param   stubSession      $session   current session 
     67     * @param   stubResponse     $response  contains response data 
     68     * @param   array            $context   optional  additional context data 
     69     * @throws  stubIOException 
    6970     */ 
    7071    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $context = array()) 
     
    7273        $existsInBasePath = file_exists(self::$baseDir . DIRECTORY_SEPARATOR . $this->source); 
    7374        if (false === $existsInBasePath && file_exists($this->source) === false) { 
    74             throw new stubException('The file ' . $this->source . ' does not exist or could not be read.'); 
     75            throw new stubIOException('The file ' . $this->source . ' does not exist or could not be read.'); 
    7576        } 
    7677         
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisIncludeTemplatePageElement.php

    r887 r888  
    77 * @subpackage  websites_memphis 
    88 */ 
    9 stubClassLoader::load('net.stubbles.websites.memphis.stubMemphisPageElement', 
     9stubClassLoader::load('net.stubbles.lang.exceptions.stubIOException', 
     10                      'net.stubbles.websites.memphis.stubMemphisPageElement', 
    1011                      'net.stubbles.websites.memphis.stubMemphisTemplate' 
    1112); 
     
    4849     * processes the page element 
    4950     * 
    50      * @param   stubRequest    $request   the request data 
    51      * @param   stubSession    $session   current session 
    52      * @param   stubResponse   $response  contains response data 
    53      * @param   array          $context   optional  additional context data 
    54      * @throws  stubException 
     51     * @param   stubRequest      $request   the request data 
     52     * @param   stubSession      $session   current session 
     53     * @param   stubResponse     $response  contains response data 
     54     * @param   array            $context   optional  additional context data 
     55     * @throws  stubIOException 
    5556     */ 
    5657    public function process(stubRequest $request, stubSession $session, stubResponse $response, array $context = array()) 
     
    6162         
    6263        if (file_exists($this->source) == false) { 
    63             throw new stubException('The template ' . $this->source . ' does not exist or could not be read.'); 
     64            throw new stubIOException('The template ' . $this->source . ' does not exist or could not be read.'); 
    6465        } 
    6566         
  • trunk/src/main/php/net/stubbles/xml/stubXMLXIncludeStreamWrapper.php

    r871 r888  
    77 * @subpackage  xml 
    88 */ 
    9 stubClassLoader::load('net.stubbles.xml.stubXMLException', 
     9stubClassLoader::load('net.stubbles.lang.exceptions.stubIOException', 
     10                      'net.stubbles.xml.stubXMLException', 
    1011                      'net.stubbles.xml.xsl.stubXSLProcessor' 
    1112); 
     
    99100     * 
    100101     * @param   string  $cachePath 
    101      * @throws  stubException 
     102     * @throws  stubIOException 
    102103     */ 
    103104    public static function setCachePath($cachePath) 
     
    106107        if (file_exists($cachePath) == false) { 
    107108            if (!@mkdir($cachePath, 0700, true)) { 
    108                 throw new stubException("Can not create cache directory " . $cachePath . '.'); 
     109                throw new stubIOException("Can not create cache directory " . $cachePath . '.'); 
    109110            } 
    110111        } 
     
    172173     * processes the file and creates a cached version of it 
    173174     * 
     175     * @throws  stubIOException 
    174176     * @throws  stubXMLException 
    175177     */ 
     
    199201        libxml_use_internal_errors($previousErrorHandling); 
    200202        if (!is_writeable($this->cachedFileName)) { 
    201             throw new stubException("Can not write cache file to {$this->cachedFileName}."); 
     203            throw new stubIOException("Can not write cache file to {$this->cachedFileName}."); 
    202204        } 
    203205