From 931a74c290a5dc7e9a54c72336b5c217a3bb229d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 23 Oct 2024 16:25:51 +0200 Subject: [libvirt] Improve error reporting by not swallowing stack trace --- .../java/org/openslx/libvirt/xml/LibvirtXmlSchemaValidator.java | 2 +- .../java/org/openslx/libvirt/xml/LibvirtXmlValidationException.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/openslx/libvirt/xml/LibvirtXmlSchemaValidator.java b/src/main/java/org/openslx/libvirt/xml/LibvirtXmlSchemaValidator.java index d589d41..da24878 100644 --- a/src/main/java/org/openslx/libvirt/xml/LibvirtXmlSchemaValidator.java +++ b/src/main/java/org/openslx/libvirt/xml/LibvirtXmlSchemaValidator.java @@ -277,7 +277,7 @@ public class LibvirtXmlSchemaValidator StreamSource source = LibvirtXmlSchemaValidator.toStreamSource( domSource ); this.rngSchemaValidator.validate( source ); } catch ( SAXException | TransformerException | IOException e ) { - throw new LibvirtXmlValidationException( e.getLocalizedMessage() ); + throw new LibvirtXmlValidationException( e ); } } } diff --git a/src/main/java/org/openslx/libvirt/xml/LibvirtXmlValidationException.java b/src/main/java/org/openslx/libvirt/xml/LibvirtXmlValidationException.java index 24e9db7..3afe85a 100644 --- a/src/main/java/org/openslx/libvirt/xml/LibvirtXmlValidationException.java +++ b/src/main/java/org/openslx/libvirt/xml/LibvirtXmlValidationException.java @@ -22,4 +22,10 @@ public class LibvirtXmlValidationException extends Exception { super( errorMsg ); } + + public LibvirtXmlValidationException( Exception other ) + { + super( other ); + } + } -- cgit v1.2.3-55-g7522