- in the panelize, cutout and geocutout Tcl commands updated the error strings and made sure that if an error occur then a potential script execution in chain is aborted

This commit is contained in:
Marius Stanciu
2022-01-29 16:24:29 +02:00
committed by Marius
parent a0fb8b5413
commit 54def9a426
5 changed files with 23 additions and 16 deletions

View File

@@ -89,17 +89,20 @@ class TclCommandPanelize(TclCommand):
try:
obj = self.app.collection.get_by_name(str(name))
except Exception:
return "Could not retrieve object: %s" % name
self.app.log.error("Could not retrieve object: %s" % name)
return "fail"
if obj is None:
return "Object not found: %s" % name
self.app.log.error("Object not found: %s" % name)
return "fail"
if 'box' in args:
boxname = args['box']
try:
box = self.app.collection.get_by_name(boxname)
except Exception:
return "Could not retrieve object: %s" % name
self.app.log.error("Could not retrieve object: %s" % name)
return "fail"
else:
box = obj
@@ -114,7 +117,8 @@ class TclCommandPanelize(TclCommand):
rows = int(0)
if 'columns' not in args and 'rows' not in args:
return "ERROR: Specify either -columns or -rows. The one not specified it will assumed to be 0"
self.app.log.error("ERROR: Specify either -columns or -rows. The one not specified it will assumed to be 0")
return "fail"
if 'outname' in args:
outname = args['outname']