Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
I'd like to introduce two new proxy streams, TaggedInputStream and TaggedOutputStream, that tag all exceptions thrown by the proxied streams. The goal is to make it easier to detect the source of an IOException when you're dealing with multiple different streams. For example:
InputStream input = ...; OutputStream output = ...; TaggedOutputStream proxy = new TaggedOutputStream(output); try { IOUtils.copy(input, proxy); } catch (IOException e) { if (proxy.isTagged(e)) { // Could not write to the output stream // Perhaps we can handle that error somehow (retry, cancel?) e.initCause(); // gives the original exception from the proxied stream } else { // Could not read from the input stream, nothing we can do throw e; } }
I'm working on a patch to implement such a feature.
Attachments
Attachments
Issue Links
- is depended upon by
-
TIKA-198 Better distinction between IOException and TikaException
- Closed