Skip to content

Commit

Permalink
fixup! fixup! Add support for escalating SDWs to Errors
Browse files Browse the repository at this point in the history
- remove redundant "warning escalated to errors" message
- formatting changes

DAFFODIL-2810
  • Loading branch information
olabusayoT committed Oct 1, 2024
1 parent 73088d3 commit 316dba1
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ class SchemaDefinitionErrorFromWarning(
warnID,
sdw.sc.toScalaOption,
sdw.annotationContext.toScalaOption,
({
val origMsg = if (sdw.mfmt.isDefined) sdw.mfmt.get else ""
val msg = s"warning escalated to error: ${warnID}. " + origMsg
msg
}),
(if (sdw.mfmt.isDefined) sdw.mfmt.get else ""),
sdw.args: _*
) {

Expand Down Expand Up @@ -290,10 +286,7 @@ trait ImplementsThrowsOrSavesSDE extends ImplementsThrowsSDE with SavesErrorsAnd
args: _*
)
if (tunable.escalateWarningsToErrors) {
val sde = new SchemaDefinitionErrorFromWarning(
sdw,
warnID
)
val sde = new SchemaDefinitionErrorFromWarning(sdw, warnID)
toss(sde)
} else {
warn(sdw)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,7 @@ abstract class ParseOrUnparseState protected (
val rsdw =
new RuntimeSchemaDefinitionWarning(warnID, ctxt.schemaFileLocation, this, str, args: _*)
if (tunable.escalateWarningsToErrors) {
val sde = new SchemaDefinitionErrorFromWarning(
rsdw,
warnID
)
val sde = new SchemaDefinitionErrorFromWarning(rsdw, warnID)
ctxt.toss(sde)
} else {
diagnostics = rsdw :: diagnostics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@
<tdml:document><![CDATA[test]]></tdml:document>
<tdml:errors>
<tdml:error>Schema Definition Warning Escalated Error</tdml:error>
<tdml:error>warning escalated to error</tdml:error>
<tdml:error>appinfoDFDLSourceWrong</tdml:error>
<tdml:error>xs:appinfo source attribute</tdml:error>
</tdml:errors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,6 @@
<tdml:document/>
<tdml:errors>
<tdml:error>Schema Definition Warning Escalated Error</tdml:error>
<tdml:error>warning escalated to error</tdml:error>
<tdml:error>variableSet</tdml:error>
<tdml:error>Cannot set variable</tdml:error>
<tdml:error>after reading the default value</tdml:error>
Expand Down

0 comments on commit 316dba1

Please sign in to comment.