fix: handle render errors (#3557)
This commit is contained in:
parent
91ab7f36e2
commit
6bebfe63be
@ -206,7 +206,7 @@ const drawElementOnCanvas = (
|
||||
context.canvas.remove();
|
||||
}
|
||||
} else {
|
||||
console.error(`Unimplemented type ${element.type}`);
|
||||
throw new Error(`Unimplemented type ${element.type}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +269,11 @@ export const renderScene = (
|
||||
);
|
||||
|
||||
visibleElements.forEach((element) => {
|
||||
try {
|
||||
renderElement(element, rc, context, renderOptimizations, sceneState);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
|
||||
if (appState.editingLinearElement) {
|
||||
@ -283,6 +287,7 @@ export const renderScene = (
|
||||
|
||||
// Paint selection element
|
||||
if (selectionElement) {
|
||||
try {
|
||||
renderElement(
|
||||
selectionElement,
|
||||
rc,
|
||||
@ -290,6 +295,9 @@ export const renderScene = (
|
||||
renderOptimizations,
|
||||
sceneState,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
if (isBindingEnabled(appState)) {
|
||||
@ -834,6 +842,7 @@ export const renderSceneToSvg = (
|
||||
// render elements
|
||||
elements.forEach((element) => {
|
||||
if (!element.isDeleted) {
|
||||
try {
|
||||
renderElementToSvg(
|
||||
element,
|
||||
rsvg,
|
||||
@ -841,6 +850,9 @@ export const renderSceneToSvg = (
|
||||
element.x + offsetX,
|
||||
element.y + offsetY,
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user