I managed to override the parseError method via mermaid.setParseErrorHandler / mermaid.parseError, but it is not working during the "bomb". As far as I understand, parseError calls only inside mermaid.init or mermaidAPI.parse, but the "bomb" explodes during the mermaid.render in the extension (by error throwing).
What I did:
I took the path of least resistance and wrapped mermaid.render in try..catch for error catching. I tried not to break the standard behavior of the mermaid library, just added the error message to the bomb.
Hi! )
I tried to add error display to the extension: https://github.com/mjbvz/vscode-markdown-mermaid/issues/129
Some details:
I managed to override the
parseError
method viamermaid.setParseErrorHandler
/mermaid.parseError
, but it is not working during the "bomb". As far as I understand,parseError
calls only inside mermaid.init or mermaidAPI.parse, but the "bomb" explodes during the mermaid.render in the extension (by error throwing).What I did:
I took the path of least resistance and wrapped
mermaid.render
in try..catch for error catching. I tried not to break the standard behavior of the mermaid library, just added the error message to the bomb.It looks like this now:
Thanks!