Changeset 1631

Show
Ignore:
Timestamp:
06/19/08 10:20:45 (3 months ago)
Author:
mikey
Message:

throw exception if skin document can not be parsed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/websites/xml/skin/stubDefaultSkinGenerator.php

    r1623 r1631  
    1212                      'net::stubbles::lang::exceptions::stubRuntimeException', 
    1313                      'net::stubbles::websites::xml::skin::stubSkinGenerator', 
     14                      'net::stubbles::xml::stubXMLException', 
    1415                      'net::stubbles::xml::stubXMLXIncludeStreamWrapper', 
    1516                      'net::stubbles::xml::stubXMLStreamWriterFactory', 
     
    191192     * @param   string       $skinName 
    192193     * @return  DOMDocument 
     194     * @throws  stubXMLException 
    193195     */ 
    194196    // @codeCoverageIgnoreStart 
    195197    protected function createXMLSkinDocument($skinName) 
    196198    { 
    197         return DOMDocument::load(stubConfig::getPagePath() . '/skin/' . $skinName . '.xml'); 
     199        $domDocument = DOMDocument::load(stubConfig::getPagePath() . '/skin/' . $skinName . '.xml'); 
     200        if (false === $domDocument) { 
     201            throw new stubXMLException('Invalid xml file ' . stubConfig::getPagePath() . '/skin/' . $skinName . '.xml'); 
     202        } 
     203         
     204        return $domDocument; 
    198205    } 
    199206    // @codeCoverageIgnoreEnd