Skip to content

Fix duplicated TDML exception output and simplify exception handling#1668

Open
gdesrosiers1805 wants to merge 1 commit into
apache:mainfrom
gdesrosiers1805:bugfix/daffodil-3078
Open

Fix duplicated TDML exception output and simplify exception handling#1668
gdesrosiers1805 wants to merge 1 commit into
apache:mainfrom
gdesrosiers1805:bugfix/daffodil-3078

Conversation

@gdesrosiers1805
Copy link
Copy Markdown

TDMLException previously embedded cause message text in the outer exception message while also passing the same cause into the Java Exception cause chain. This resulted in duplicate output, where the same error appeared both in the exception message and again in the "Caused by:" section.

-Simplified TDMLException to support two construction paths only:
one for explicit message strings, and one for wrapping a Throwable.
Removed the causes field from the TDMLException trait and use cause
from TDMLExceptionImpl constructor parameter.
-Also removed the constructor that accepted multiple causes. Callers
that previously passed multiple exceptions now aggregate their
messages into a single newline-delimited message before constructing
the string-based exception.
-Additionally updated TDMLRunner to catch XMLDifferenceException
directly when calling XMLUtils.compareAndReport, since that method
specifically throws XMLDifferenceException.

DAFFODIL-3078

TDMLException previously embedded cause message text in the outer
exception message while also passing the same cause into the Java
Exception cause chain. This resulted in duplicate output, where the
same error appeared both in the exception message and again in the
"Caused by:" section.

-Simplified TDMLException to support two construction paths only:
 one for explicit message strings, and one for wrapping a Throwable.
 Removed the causes field from the TDMLException trait and use cause
 from TDMLExceptionImpl constructor parameter.
-Also removed the constructor that accepted multiple causes. Callers
 that previously passed multiple exceptions now aggregate their
 messages into a single newline-delimited message before constructing
 the string-based exception.
-Additionally updated TDMLRunner to catch XMLDifferenceException
 directly when calling XMLUtils.compareAndReport, since that method
 specifically throws XMLDifferenceException.

DAFFODIL-3078
Copy link
Copy Markdown
Member

@stevedlawrence stevedlawrence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants