mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-25 02:09:50 +02:00
#3395 Fix for lopp stopping at first failure
This commit is contained in:
@@ -35,9 +35,6 @@ const init = function () {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
log.warn('Syntax Error rendering');
|
log.warn('Syntax Error rendering');
|
||||||
log.warn(e.str);
|
log.warn(e.str);
|
||||||
if (this.parseError) {
|
|
||||||
this.parseError(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -93,8 +90,10 @@ const initThrowsErrors = function () {
|
|||||||
const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
|
const idGenerator = new utils.initIdGenerator(conf.deterministicIds, conf.deterministicIDSeed);
|
||||||
|
|
||||||
let txt;
|
let txt;
|
||||||
|
const errors = [];
|
||||||
|
|
||||||
for (let i = 0; i < nodes.length; i++) {
|
for (let i = 0; i < nodes.length; i++) {
|
||||||
|
log.info('Rendering diagram: ' + nodes[i].id, i);
|
||||||
// element is the current div with mermaid class
|
// element is the current div with mermaid class
|
||||||
const element = nodes[i];
|
const element = nodes[i];
|
||||||
|
|
||||||
@@ -134,10 +133,16 @@ const initThrowsErrors = function () {
|
|||||||
element
|
element
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.warn('Catching Error (bootstrap)');
|
log.warn('Catching Error (bootstrap)', error);
|
||||||
throw { error, message: error.str };
|
if (typeof mermaid.parseError === 'function') {
|
||||||
|
mermaid.parseError({ error, str: error.str, hash: error.hash, message: error.str });
|
||||||
|
}
|
||||||
|
errors.push({ error, str: error.str, hash: error.hash, message: error.str });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (errors.length > 0) {
|
||||||
|
throw errors[0];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const initialize = function (config) {
|
const initialize = function (config) {
|
||||||
|
Reference in New Issue
Block a user