XMLWriter should check for IO errors
Original issue 352 created by sean.flani... on 2013-07-22T00:23:22.000Z:
What steps will reproduce the problem?
1. Use net.sf.okapi.common.XMLWriter to write to a socket (eg in a web service)
2. Close the socket (eg user cancels download)
What is the expected output? What do you see instead?
Either the write* methods should throw an exception, or failing that, PrintWriter's checkError() method should be exposed so that the caller can check for an exception.
Instead, XMLWriter silently swallows an IOException every time write is called, until eventually the caller stops writing data. This takes a lot longer than usual because of all the IOExceptions being thrown and caught.
What version of the product are you using? On what operating system?
0.21
Please provide any additional information below.
This problem also affects TMXWriter, TMXFilterWriter and XLIFFWriter which all use XMLWriter.
Comments (2)
-
Account Deleted -
Account Deleted - changed status to resolved
Comment 2. originally posted by @ysavourel on 2013-07-22T04:01:43.000Z:
This issue was closed by revision 17126ef089e8.
- Log in to comment
Comment 1. originally posted by sean.flani... on 2013-07-22T02:14:11.000Z:
Workaround: When constructing the XMLWriter, pass in a PrintWriter (not just a Writer), and call checkError() on the PrintWriter after each write.