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);} Copy
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);}
Readonly
The error a malformed MWL document throws, carrying the diagnostic that describes it.
Example