Show
Ignore:
Timestamp:
05/21/08 17:30:18 (5 months ago)
Author:
mikey
Message:

more verbose exception messages

Files:

Legend:

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

    r1359 r1571  
    8383            if (!empty($errors)) { 
    8484                libxml_clear_errors(); 
    85                 throw new stubXMLException('Error writing start element: ' . $this->convertLibXmlErrorsToString($errors)); 
    86             } 
    87         } catch (DOMException $e) { 
    88             throw new stubXMLException('Error writing start element.', $e); 
     85                throw new stubXMLException('Error writing start element: "' . $elementName . '": ' . $this->convertLibXmlErrorsToString($errors)); 
     86            } 
     87        } catch (DOMException $e) { 
     88            throw new stubXMLException('Error writing start element "' . $elementName . '".', $e); 
    8989        } 
    9090    } 
     
    218218            if (!empty($errors)) { 
    219219                libxml_clear_errors(); 
    220                 throw new stubXMLException('Error writing attribute: ' . $this->convertLibXmlErrorsToString($errors)); 
    221             } 
    222         } catch (DOMException $e) { 
    223             throw new stubXMLException('Error writing attribute.', $e); 
     220                throw new stubXMLException('Error writing attribute: "' . $attributeName . ':' . $attributeValue . '":' . $this->convertLibXmlErrorsToString($errors)); 
     221            } 
     222        } catch (DOMException $e) { 
     223            throw new stubXMLException('Error writing attribute "' . $attributeName . ':' . $attributeValue . '".', $e); 
    224224        } 
    225225    } 
     
    267267            if (!empty($errors)) { 
    268268                libxml_clear_errors(); 
    269                 throw new stubXMLException('Error writing element: ' . $this->convertLibXmlErrorsToString($errors)); 
    270             } 
    271         } catch (DOMException $e) { 
    272             throw new stubXMLException('Error writing element.', $e); 
     269                throw new stubXMLException('Error writing element: "' . $elementName . '":' . $this->convertLibXmlErrorsToString($errors)); 
     270            } 
     271        } catch (DOMException $e) { 
     272            throw new stubXMLException('Error writing element"' . $elementName . '".', $e); 
    273273        } 
    274274    }