SemanticMediaWiki / Mermaid

Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
https://www.mediawiki.org/wiki/Extension:Mermaid
Other
36 stars 24 forks source link

Better error handling #71

Open LordAro opened 3 years ago

LordAro commented 3 years ago

Currently, if you make an error in the mermaid text, the error is only displayed in the devtools console, which isn't particularly user friendly.

With #69 & 8.10.2, it appears to have gotten worse, with no console message and only the following image being displayed:

image

which is even less helpful.

Can we get a better way of displaying errors?

The mermaid docs mention a parseError function, which seems designed for this purpose - https://mermaid-js.github.io/mermaid/#/usage?id=advanced-usage . I had a brief play, but couldn't get it to work with the existing initialize & init workflow in ext.mermaid.js (which appears to be deprecated anyway, according to the documentation?)