stevedlawrence commented on code in PR #1322:
URL: https://github.com/apache/daffodil/pull/1322#discussion_r1778862202
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala:
##########
@@ -262,14 +262,26 @@ trait ImplementsThrowsOrSavesSDE extends
ImplementsThrowsSDE with SavesErrorsAnd
val suppress = lssdw.contains(warnID) || lssdw.contains(WarnID.All) ||
tssdw.contains(warnID) || tssdw.contains(WarnID.All)
if (!suppress) {
- val sdw = new SchemaDefinitionWarning(
- warnID,
- Some(schemaFileLocation),
- NoAnnotationContext,
- fmt,
- args: _*
- )
- warn(sdw)
+ if (tunable.escalateWarningsToErrors) {
+ val msg = "warnings escalated to errors: " + fmt
+ val sde = new SchemaDefinitionError(
Review Comment:
Yeah, something like that could probably work.
Another approach, could maybe just extend SchemaDefinitionWarning, and
overide a few memers,e.g
```scala
class SchemaDefinitionErrorFromWarning(...) extends
SchemaDefinitionWarning(...) {
override def isError = "true"
override def modeName = super.modeName + " Escalated"
}
```
I'm not sure what the best appraoch is, but something that can minimize
duplication and will automatically inherit any future changes made to SDW would
be nice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]