File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -551,7 +551,21 @@ def btn_clicked_slice(self):
551
551
self .statusbar .update ()
552
552
# must keep this return statement to abort execution!
553
553
return
554
- elif not self .fvar_table_model .instance_data_validates_missing_data ():
554
+
555
+ # validate axis editor instance values
556
+ # returns True/False response for test of
557
+ # at least one instance value
558
+ # raises ValueError on attempt to cast to float
559
+ # if the entry is a non-numeric value
560
+ try :
561
+ instance_values_are_present = (
562
+ self .fvar_table_model .instance_data_validates_missing_data ()
563
+ )
564
+ except ValueError as e :
565
+ SliceErrorDialog (f"{ e } " )
566
+ return
567
+
568
+ if not instance_values_are_present :
555
569
SliceErrorDialog (
556
570
"You requested the same design space that is supported in the "
557
571
"font path that you are processing. Please define at least one "
Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ def get_instance_data(self):
288
288
except ValueError :
289
289
raise ValueError (
290
290
f"'{ axis_value } ' is not a valid { axistag } axis value. "
291
- f"Please enter a valid value and try again."
291
+ f"Please enter a single numeric value and try again."
292
292
)
293
293
294
294
return instance_data
@@ -298,7 +298,10 @@ def instance_data_validates_missing_data(self):
298
298
# axis tag with a defined instance, and False if all
299
299
# axis tags have blank entry fields = the original variable
300
300
# font that the user entered
301
- return len (self .get_instance_data ()) != 0
301
+ try :
302
+ return len (self .get_instance_data ()) != 0
303
+ except ValueError as e :
304
+ raise e
302
305
303
306
def get_default_axis_value (self , axistag ):
304
307
if axistag in self .fvar_axes :
You can’t perform that action at this time.
0 commit comments