Skip to content

Nicer Error location ? #390

@MarcWeber

Description

@MarcWeber

While pos 50 is nice its nicer to just see where something goes wrong.

So it would be nice if there was a second parser which returend left/right or such
where left contains something like

TEXT:
abc<ERROR HERE>def

Catching the exception and using this works for me for the time being:

if (m = e.toString().match(/at char ([^ ]+)/)){
    const p = parseInt(m[1])
    text = text.slice(0, p)+"HERE"+text.slice(p)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions