Skip to content

How to get parse to throw Error when XML document is given? #506

Closed Answered by eemeli
RopoMen asked this question in Q&A
Discussion options

You must be logged in to vote

The short answer here is "no", given that this is an explicit feature of the library:

Can accept any string as input without throwing, parsing as much YAML out of it as it can

But if you're e.g. using the parseDocument API, you can check that errors array of the output is empty.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RopoMen
Comment options

@RopoMen
Comment options

@eemeli
Comment options

Answer selected by RopoMen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants