Skip to content

Commit bff547a

Browse files
committed
Improved error message when metadata serialization fails
Reason is that when this occurs in a DMSDK setting, only the message is logged, which isn't helpful at all for debugging.
1 parent ef7632a commit bff547a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/io/DocumentMetadataHandle.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -787,12 +787,8 @@ private void sendMetadataImpl(OutputStream out) {
787787

788788
serializer.flush();
789789
serializer.close();
790-
} catch (XMLStreamException e) {
791-
throw new MarkLogicIOException("Failed to serialize metadata", e);
792-
} catch (TransformerFactoryConfigurationError e) {
793-
throw new MarkLogicIOException("Failed to serialize metadata", e);
794-
} catch (TransformerException e) {
795-
throw new MarkLogicIOException("Failed to serialize metadata", e);
790+
} catch (Exception e) {
791+
throw new MarkLogicIOException("Failed to serialize metadata: cause: " + e.getMessage(), e);
796792
}
797793
}
798794

0 commit comments

Comments
 (0)