Skip to content

Catching errors #6

@mebibou

Description

@mebibou

When there is an error in the json, is there a way to catch it? even by using (error)="onError(event), the code always throws this error:

textmode.js:324 Error in onChange callback:  Error: Parse error on line 8:
...inputString",      },      {        "
----------------------^
Expecting 'STRING', got '}'
    at Object.parseError (jsonlint.js:55)
    at Object.parse (jsonlint.js:132)
    at Object.validate (util.js:223)
    at Object.parse (util.js:17)
    at JSONEditor.textmode.get (textmode.js:526)
    at Object.onChange (index.js:46)
    at JSONEditor.textmode._onChange (textmode.js:321)
    at Editor.EventEmitter._signal (index.js:3865)
    at Editor.onDocumentChange (index.js:13292)
    at EditSession.EventEmitter._signal (index.js:3865)

And therefore we never actually catch any errors.

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