You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2019/01/09 14:29:42 UTC

[GitHub] jadams-tresys commented on a change in pull request #162: Properly handle malformed binding files

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:
users@infra.apache.org


With regards,
Apache Git Services