jadams-tresys commented on a change in pull request #162: Properly handle 
malformed binding files
URL: https://github.com/apache/incubator-daffodil/pull/162#discussion_r246401349
 
 

 ##########
 File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
 ##########
 @@ -627,7 +630,22 @@ object Main extends Logging {
         val extVarBindingNodeOpt = (configNode \ 
"externalVariableBindings").headOption
         extVarBindingNodeOpt match {
           case None => Seq.empty
-          case Some(extVarBindingsNode) => 
ExternalVariablesLoader.getVariables(extVarBindingsNode, tunables)
+          case Some(extVarBindingsNode) => {
+            try {
+              ExternalVariablesLoader.getVariables(extVarBindingsNode, 
tunables)
+            } catch {
+              case qupe: QNameUndefinedPrefixException => {
+                log(LogLevel.Warning, qupe.getMessage)
+                log(LogLevel.Warning, "Undefined QName prefix in external 
variable binding file. Continuing with default values")
+                Seq.empty
+              }
+              case qse: QNameSyntaxException => {
+                log(LogLevel.Warning, qse.getMessage)
+                log(LogLevel.Warning, "QName syntax error in external variable 
binding file. Continuing with default values")
+                Seq.empty
+              }
 
 Review comment:
   Makes sense. I wasn't sure what the correct behaviour for this was.
   
   I will make the change to a fatal error.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to