mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-21 06:53:17 +08:00
Throw error when detecting diagram type failed and suppressErrorRendering
is set
This commit is contained in:
parent
2c5d83fab3
commit
b4618f9ba1
@ -476,6 +476,9 @@ const render = async function (
|
|||||||
try {
|
try {
|
||||||
diag = await getDiagramFromText(text);
|
diag = await getDiagramFromText(text);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (config.suppressErrorRendering) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
diag = new Diagram('error');
|
diag = new Diagram('error');
|
||||||
parseEncounteredException = error;
|
parseEncounteredException = error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user