mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2025-01-10 19:35:09 +01:00
better error handling
This commit is contained in:
parent
d7a525f75b
commit
a79308dc8f
@ -26,10 +26,14 @@ export default class {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
sliceSync(settings, onProgress) {
|
sliceSync(settings, onProgress) {
|
||||||
|
if (typeof this.geometry === 'undefined') {
|
||||||
|
throw new Error('Geometry is not set, use Slicer.setGeometry or Slicer.setMesh first');
|
||||||
|
}
|
||||||
|
|
||||||
return slice(this.geometry, settings, onProgress);
|
return slice(this.geometry, settings, onProgress);
|
||||||
}
|
}
|
||||||
slice(settings, onProgress) {
|
slice(settings, onProgress) {
|
||||||
if (!this.geometry) {
|
if (typeof this.geometry === 'undefined') {
|
||||||
throw new Error('Geometry is not set, use Slicer.setGeometry or Slicer.setMesh first');
|
throw new Error('Geometry is not set, use Slicer.setGeometry or Slicer.setMesh first');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user