mwg API
    Preparing search index...

    Class MwlSyntaxError

    The error a malformed MWL document throws, carrying the diagnostic that describes it.

    import { parse, MwlSyntaxError } from '@datamoc/mw_games/mwl';

    try {
    parse('[{ tag: "game" }]', 'broken.mwl');
    } catch (error) {
    if (error instanceof MwlSyntaxError) console.log(error.diagnostic.code);
    }

    Hierarchy

    • Error
      • MwlSyntaxError
    Index
    diagnostic: MwlDiagnostic