How to detect if FileNode operator >> (stream) failed

that API is terribly old, and terribly terrible too.

It’s not for arbitrary XML files, only for those written by, or compatible to, cv::FileStorage. just saying, because someone previously thought they could use that for some arbitrary XML

I just browsed the docs. there are methods equivalent to >> but those return nothing and the docs don’t say they’d throw anything either. the FileStorage and FileNode classes don’t appear to store any errors either, that you’d have to check for.

In some of the examples, I see them calling node.empty() so maybe that’s how you’re expected to handle this. IDK. also there’s isOpened() but I have no idea if that just covers opening the file or also reading it.

I don’t even know if anyone has defined a schema for that XML. if there is a schema, you could use some other library to validate your XML file.