Add control for errors.

This commit is contained in:
Paulo Gustavo Veiga 2022-12-04 22:03:55 -08:00
parent 3a505224f6
commit 0246851f41
3 changed files with 20 additions and 16 deletions

View File

@ -5,9 +5,9 @@ Cypress.on('window:before:load', (win) => {
cy.spy(win.console, 'warn'); cy.spy(win.console, 'warn');
}); });
// // afterEach(() => { // afterEach(() => {
// // cy.window().then((win) => { // cy.window().then((win) => {
// // expect(win.console.error).to.have.callCount(0); // expect(win.console.error).to.have.callCount(0);
// // expect(win.console.warn).to.have.callCount(0); // expect(win.console.warn).to.have.callCount(0);
// // }); // });
// }); // });

View File

@ -88,7 +88,7 @@ const Editor = ({
model.registerEvents(setCanvasUpdate, capability); model.registerEvents(setCanvasUpdate, capability);
}) })
.catch((e) => { .catch((e) => {
console.error(e); console.error(JSON.stringify(e));
window.newrelic?.noticeError( window.newrelic?.noticeError(
new Error(`Unexpected error loading map ${mapInfo.getId()} = ${JSON.stringify(e)}`), new Error(`Unexpected error loading map ${mapInfo.getId()} = ${JSON.stringify(e)}`),
); );

View File

@ -494,18 +494,22 @@ class XMLSerializerTango implements XMLMindmapSerializer {
const model = mindmap.createRelationship(srcId, destId); const model = mindmap.createRelationship(srcId, destId);
model.setLineType(lineType); model.setLineType(lineType);
const spoint = Point.fromString(srcCtrlPoint); if (srcCtrlPoint) {
if (spoint) { const spoint = Point.fromString(srcCtrlPoint);
model.setSrcCtrlPoint(spoint); if (spoint) {
} else { model.setSrcCtrlPoint(spoint);
console.error(`srcCtrlPoint could not be parsed: ${srcCtrlPoint}`); } else {
console.error(`srcCtrlPoint could not be parsed: ${srcCtrlPoint}`);
}
} }
const dpoint = Point.fromString(destCtrlPoint); if (destCtrlPoint) {
if (dpoint) { const dpoint = Point.fromString(destCtrlPoint);
model.setDestCtrlPoint(dpoint); if (dpoint) {
} else { model.setDestCtrlPoint(dpoint);
console.error(`destCtrlPoint could not be parsed: ${destCtrlPoint}`); } else {
console.error(`destCtrlPoint could not be parsed: ${destCtrlPoint}`);
}
} }
model.setEndArrow(false); model.setEndArrow(false);