Skip to content

SaltUtils.writeDocumentGraph(...) mask internal errors with "Stream Closed" exception. #115

Description

@thomaskrause

When there is an internal exception writeDocumentGraph(...) the finally block is triggered and attempts to close the XML stream:

https://github.com/korpling/salt/blob/develop/salt-api/src/main/java/org/corpus_tools/salt/util/internal/persistence/SaltXML10Writer.java#L352

Unfortunately the stream might be already closed due to the previous exception and closing it will trigger a new exception that the stream is already closed. This new exception is reported to the user in the logging and the console output and thus mask the actual original problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions