Skip to content

Commit

Permalink
Fix Interactive Debugger Error
Browse files Browse the repository at this point in the history
- suppress RSDE when using debugger
- add cause to RSDE and override getCause

DAFFODIL-2810
  • Loading branch information
olabusayoT committed Oct 8, 2024
1 parent 13b3946 commit 96dbd6b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class RelativePathPastRootError(schemaContext: SchemaFileLocation, kind: String,

class RuntimeSchemaDefinitionError(
schemaContext: SchemaFileLocation,
causedBy: Throwable,
fmtString: String,
args: Any*
) extends SchemaDefinitionError(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 96dbd6b

Please sign in to comment.