olabusayoT commented on code in PR #1322:
URL: https://github.com/apache/daffodil/pull/1322#discussion_r1778746081
##########
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:
I think includinf the warnID is a great idea
To add a new SDE class that supports both RuntimeSDW and regular SDW, we'd
need to expose the arguments of SchemaDefinitionDiagnosticBase (SDDB) and make
sure we can access them from the passed in sdw. Is this acceptable? I'm
thinking adding vals to the args of SDDB and then doing something like:
```
class SchemaDefinitionErrorFromWarning(
sdw: SchemaDefinitionDiagnosticBase
) extends SchemaDefinitionError(
(if (sdw.sc.isDefined) Some(sdw.sc.get) else None),
...
) {
```
--
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]