You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Knut-Olav Hoven (JIRA)" <ji...@apache.org> on 2013/08/20 10:28:52 UTC

[jira] [Created] (JENA-517) Unhandled exception point of model write

Knut-Olav Hoven created JENA-517:
------------------------------------

             Summary: Unhandled exception point of model write
                 Key: JENA-517
                 URL: https://issues.apache.org/jira/browse/JENA-517
             Project: Apache Jena
          Issue Type: Bug
          Components: Jena
    Affects Versions: Jena 2.10.1
            Reporter: Knut-Olav Hoven


Method "N3JenaWriterCommon.write()" silently ignores IOException from Writer.flush() while writing a model to an OutputStream.

This might lead to debugging nightmares.

Should at the very least throw some runtime exception wrapping the original exception :)

{code}
	@Override
    public synchronized void write(Model model, OutputStream output, String base) 
	{
		try {
			Writer w =  new BufferedWriter(new OutputStreamWriter(output, "UTF-8")) ;
			write(model, w, base) ;
			try { w.flush() ; } catch (IOException ioEx) {}
		} catch (java.io.UnsupportedEncodingException ex)
		{
			System.err.println("Failed to create UTF-8 writer") ;
		}
	}
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira