jw3 commented on a change in pull request #431:
URL: https://github.com/apache/incubator-daffodil/pull/431#discussion_r504208707
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
##########
@@ -702,10 +706,22 @@ class ParseResult(dp: DataProcessor, override val
resultState: PState)
*/
def validateResult(bytes: Array[Byte]): Unit = {
Assert.usage(resultState.processorStatus eq Success)
- val schemaURIStrings =
resultState.infoset.asInstanceOf[InfosetElement].runtimeData.schemaURIStringsForFullValidation
+
+ val (v, args) = dp.validationMode match {
+ case ValidationMode.Custom(name, args) =>
+ Validators.find(name).getOrElse(
+ Assert.abort(s"Validator '$name' not found")
Review comment:
@stevedlawrence added the guard in `withValidationMode`, seems clean
enough
@mbeckerle
>I don't think Assert.abort is appropriate here.
I recall now that the assert was there because I was hoping to guard against
missing validators making it to that point. It is changed it over to an
exception now, but after the `withValidationMode` change I have the feeling it
could still be an assert of some kind. Im good either way
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]