Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

octl tool unable to write logical groups to an empty file #9

Open
barajas opened this issue Jun 22, 2017 · 1 comment
Open

octl tool unable to write logical groups to an empty file #9

barajas opened this issue Jun 22, 2017 · 1 comment
Labels

Comments

@barajas
Copy link
Contributor

barajas commented Jun 22, 2017

Description:

While creating a logical group using the octl tool with a given empty file the logical group is not added.

Expected behavior:

I expect to see the logical group added on the given file and a completion message after executing it:

Grouping: Add done successfully!

Actual behavior:

I do not see the completion message and the file remains empty.

Reproduction steps:

$ touch test.xml
$ ./octl -l test.xml grouping add test1 c8

ERROR: [[INVALID],INVALID] : pugi_parser: Cannot open file 'test.xml' because No document element found
ERROR: [[61621,0],0] : pugi_parser: Cannot open file 'test.xml' because No document element found

Specifications:

  • version: cad49d9
  • platform: CentOS 7.2
  • Component: octl tool
@ericho
Copy link
Member

ericho commented Jun 22, 2017

It looks like this is the suspicious code

int pugi_impl::loadFile()
{
    xml_parse_result result = doc.load_file(file.c_str(), parse_default | parse_comments);
    if (result){
        return convertXmlNodeToOpalList(doc,root);
    }
    throw unableToOpenFile(file, result.description());
}

Any error from load_file() throws a unableToOpenFile exception. This is not good, because according to pugixml documentation we are assuming that all errors are related with open file operations.

@ericho ericho added the bug label Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants