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

How to find error line and pos if YAML loading failed #410

Open
xuboying opened this issue Aug 18, 2016 · 2 comments
Open

How to find error line and pos if YAML loading failed #410

xuboying opened this issue Aug 18, 2016 · 2 comments

Comments

@xuboying
Copy link

f0b15cd

as title
in debug, I can see the pos, but not sure how to hand it neatly in application

  •   mark    {pos=821 line=34 column=25 }    YAML::Mark
    
@jbeder
Copy link
Owner

jbeder commented Aug 18, 2016

Print it? I'm not sure what you're asking.

@xuboying
Copy link
Author

Hi
Sorry, I did not realize the exception function exist, maybe there could be an example in wiki?

    try{
        m_yaml = YAML::Load(m_yaml_raw);
    }
    catch(YAML::ParserException & e){
        wxString tmp;
        tmp.Printf("Line=%d, Column=%d Pos=%d Msg=%s", e.mark.line, e.mark.column, e.mark.pos, e.msg);
        wxMessageBox(tmp);
        return false;
    }

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

No branches or pull requests

2 participants