diff --git a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/debugger/InteractiveDebugger.scala b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/debugger/InteractiveDebugger.scala index e51462160a..4e50ca10c9 100644 --- a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/debugger/InteractiveDebugger.scala +++ b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/debugger/InteractiveDebugger.scala @@ -355,8 +355,8 @@ class InteractiveDebugger( // Most errors are coming back here as RSDE because that's what they get upconverted into. // Most expression problems are considered SDE. // - case _: RuntimeSchemaDefinitionError => { - state.setSuccess() + case e: RuntimeSchemaDefinitionError => { + state.suppressDiagnosticAndSucceed(e) false } } diff --git a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala index 16ca935563..145bccb3a7 100644 --- a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala +++ b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dsom/SDE.scala @@ -71,6 +71,7 @@ class RelativePathPastRootError(schemaContext: SchemaFileLocation, kind: String, class RuntimeSchemaDefinitionError( schemaContext: SchemaFileLocation, + causedBy: Throwable, fmtString: String, args: Any* ) extends SchemaDefinitionError( @@ -80,7 +81,16 @@ class RuntimeSchemaDefinitionError( args: _* ) { + def this( + schemaContext: SchemaFileLocation, + fmtString: String, + args: Any* + ) = + this(schemaContext, null, fmtString, args: _*) + override def modeName = "Runtime Schema Definition" + + override def getCause: Throwable = causedBy } class RuntimeSchemaDefinitionWarning( diff --git a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/ParseErrors.scala b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/ParseErrors.scala index a6f0876192..0540839a46 100644 --- a/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/ParseErrors.scala +++ b/daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/ParseErrors.scala @@ -141,7 +141,11 @@ trait DoSDEMixin { } case other => { val sde = - new RuntimeSchemaDefinitionError(state.getContext().schemaFileLocation, e.getMessage) + new RuntimeSchemaDefinitionError( + state.getContext().schemaFileLocation, + e, + e.getMessage + ) state.setFailed(sde) state.toss(sde) }