You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2006/07/13 04:38:30 UTC

[jira] Updated: (XERCESJ-1173) BaseMarkupSerializer.endDocument doesn't throw an SAXException when disk is full

     [ http://issues.apache.org/jira/browse/XERCESJ-1173?page=all ]

Michael Glavassevich updated XERCESJ-1173:
------------------------------------------

    Component: Serialization
      Version: 2.8.0

> BaseMarkupSerializer.endDocument doesn't throw an SAXException when disk is full
> --------------------------------------------------------------------------------
>
>          Key: XERCESJ-1173
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1173
>      Project: Xerces2-J
>         Type: Bug

>   Components: Serialization
>     Versions: 2.8.0
>  Environment: Windows 2000
>     Reporter: Mark Arends

>
> When disk is full no exception was thrown when the endDocument method is called. This resulted in empty xml files being written.
> After the _printer.flush() the method _printer.getException should be called to determine if there was an exception. The following code should solve this I think:
>     /**
>      * Called at the end of the document to wrap it up.
>      * Will flush the output stream and throw an exception
>      * if any I/O error occured while serializing.
>      *
>      * @throws SAXException An I/O exception occured during
>      *  serializing
>      */
>     public void endDocument()
>         throws SAXException
>     {
>         try {
>         // Print all the elements accumulated outside of
>         // the root element.
>         serializePreRoot();
>         // Flush the output, this is necessary for fStrBuffered output.
>         _printer.flush();
>        // Find out if there was an exception
>         if ( _printer.getException() != null ){
>             throw _printer.getException();
> 	}
> 	
>         } catch ( IOException except ) {
>             throw new SAXException( except );
>     }
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org