You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2023/01/17 18:44:25 UTC
[GitHub] [daffodil] mike-mcgann opened a new pull request, #916: DAFFODIL-1026: Handle configuration exceptions
mike-mcgann opened a new pull request, #916:
URL: https://github.com/apache/daffodil/pull/916
If an invalid configuration file is passed on the command line an unexpected exception occurs. This has been fixed to now handle this exception. All `SAXParseException`s thrown by the configuration loader are now caught and wrapped into a new `DaffodilConfigException` class. This Exception is now recognized by the CLI which logs the message and exits with a code of 26.
[DAFFODIL-1026](https://issues.apache.org/jira/browse/DAFFODIL-1026)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil] mike-mcgann commented on a diff in pull request #916: DAFFODIL-1026: Handle configuration exceptions
Posted by GitBox <gi...@apache.org>.
mike-mcgann commented on code in PR #916:
URL: https://github.com/apache/daffodil/pull/916#discussion_r1073562396
##########
daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd:
##########
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
Review Comment:
Updated
##########
daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd:
##########
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:tns="http://example.com"
+ targetNamespace="http://example.com">
+
+ <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
+ <xs:annotation>
+ <xs:appinfo source="http://www.ogf.org/dfdl/">
+ <dfdl:format ref="ex:GeneralFormat"/>
+ </xs:appinfo>
+ </xs:annotation>
+
+ <xs:element name="single" type="xs:string"/>
+</xs:schema>
Review Comment:
Updated
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil] tuxji commented on a diff in pull request #916: DAFFODIL-1026: Handle configuration exceptions
Posted by GitBox <gi...@apache.org>.
tuxji commented on code in PR #916:
URL: https://github.com/apache/daffodil/pull/916#discussion_r1072879501
##########
daffodil-cli/src/it/scala/org/apache/daffodil/parsing/TestCLIParsing.scala:
##########
@@ -695,4 +695,13 @@ class TestCLIparsing {
} (ExitCode.Success)
}
+ @Test def test_Invalid_Configuration_File(): Unit = {
+ val schema = path("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd")
+ val config = path("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single_conf_bad.txt")
+
+ runCLI(args"parse -s $schema -c $config") { cli =>
+ cli.sendLine("0", inputDone = true)
+ cli.expectErr("Unable to load configuration")
+ }(ExitCode.ConfigError)
Review Comment:
Rest of tests have a whitespace character separating } and (, please add one here.
##########
daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd:
##########
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:tns="http://example.com"
+ targetNamespace="http://example.com">
+
+ <xs:include schemaLocation="org/apache/daffodil/xsd/DFDLGeneralFormat.dfdl.xsd" />
+ <xs:annotation>
+ <xs:appinfo source="http://www.ogf.org/dfdl/">
+ <dfdl:format ref="ex:GeneralFormat"/>
+ </xs:appinfo>
+ </xs:annotation>
+
+ <xs:element name="single" type="xs:string"/>
+</xs:schema>
Review Comment:
Last character in file should be a newline.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil] mbeckerle commented on a diff in pull request #916: DAFFODIL-1026: Handle configuration exceptions
Posted by GitBox <gi...@apache.org>.
mbeckerle commented on code in PR #916:
URL: https://github.com/apache/daffodil/pull/916#discussion_r1072868838
##########
daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd:
##########
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
Review Comment:
By convention the extension for DFDL schemas is ".dfdl.xsd"
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil] mike-mcgann commented on a diff in pull request #916: DAFFODIL-1026: Handle configuration exceptions
Posted by GitBox <gi...@apache.org>.
mike-mcgann commented on code in PR #916:
URL: https://github.com/apache/daffodil/pull/916#discussion_r1073562676
##########
daffodil-cli/src/it/scala/org/apache/daffodil/parsing/TestCLIParsing.scala:
##########
@@ -695,4 +695,13 @@ class TestCLIparsing {
} (ExitCode.Success)
}
+ @Test def test_Invalid_Configuration_File(): Unit = {
+ val schema = path("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single.xsd")
+ val config = path("daffodil-cli/src/it/resources/org/apache/daffodil/CLI/single_conf_bad.txt")
+
+ runCLI(args"parse -s $schema -c $config") { cli =>
+ cli.sendLine("0", inputDone = true)
+ cli.expectErr("Unable to load configuration")
+ }(ExitCode.ConfigError)
Review Comment:
Updated
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [daffodil] stevedlawrence merged pull request #916: Handle configuration exceptions
Posted by "stevedlawrence (via GitHub)" <gi...@apache.org>.
stevedlawrence merged PR #916:
URL: https://github.com/apache/daffodil/pull/916
--
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.
To unsubscribe, e-mail: commits-unsubscribe@daffodil.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org