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

Improve error if root tag contains invalid character #555

Open
Christilut opened this issue Feb 17, 2020 · 0 comments · May be fixed by #565
Open

Improve error if root tag contains invalid character #555

Christilut opened this issue Feb 17, 2020 · 0 comments · May be fixed by #565

Comments

@Christilut
Copy link

Took me a while to figure this error out: Error: Invalid character in name which comes from the XmlBuilder.

Turns out this came from the fact that I accidentally did something like this:

builder.buildObject({ 
  $: {
    foo: 'bar'
  },
   ...
}

And the $ is assumed to be the attrKey but gives the above error when used on the root node.

I thought there was something wrong with the attrKey setting or some other bug.

So maybe a quick check can be added with a better error message so others don't fall into this.

@jhorbulyk jhorbulyk linked a pull request Apr 8, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant