Handle export errors with empty scene or KCL errors (#2477)
* Update Cargo.lock * Handle bad or empty scene export Log error and send toast to user * fmt
This commit is contained in:
@ -300,8 +300,23 @@ export const ModelingMachineProvider = ({
|
|||||||
selectionRanges
|
selectionRanges
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
'Has exportable geometry': () =>
|
'Has exportable geometry': () => {
|
||||||
kclManager.kclErrors.length === 0 && kclManager.ast.body.length > 0,
|
if (
|
||||||
|
kclManager.kclErrors.length === 0 &&
|
||||||
|
kclManager.ast.body.length > 0
|
||||||
|
)
|
||||||
|
return true
|
||||||
|
else {
|
||||||
|
let errorMessage = 'Unable to Export '
|
||||||
|
if (kclManager.kclErrors.length > 0)
|
||||||
|
errorMessage += 'due to KCL Errors'
|
||||||
|
else if (kclManager.ast.body.length === 0)
|
||||||
|
errorMessage += 'due to Empty Scene'
|
||||||
|
console.error(errorMessage)
|
||||||
|
toast.error(errorMessage)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
services: {
|
services: {
|
||||||
'AST-undo-startSketchOn': async ({ sketchDetails }) => {
|
'AST-undo-startSketchOn': async ({ sketchDetails }) => {
|
||||||
|
Reference in New Issue
Block a user