Skip to content

Commit

Permalink
better catching of null input values
Browse files Browse the repository at this point in the history
  • Loading branch information
Crispin committed Oct 20, 2020
1 parent 46f86db commit e8874aa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arcscripts/sdna_environment.py
Expand Up @@ -317,10 +317,12 @@ def ReadFeatures(self,filename,fields):
#http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
converted_value = typ()
else:
name = fieldnames[i]
msg = "Failed to convert %s (in field %s line %s) to %s"%tuple(map(str,[value,name,fid,typ]))
self.AddError(msg)
sys.exit(1)
raise TypeError
except TypeError:
name = fieldnames[i]
msg = "Failed to convert %s (in field %s line %s) to %s"%tuple(map(str,[value,name,fid,typ]))
self.AddError(msg)
sys.exit(1)
fielddata += [converted_value]
if list(record.shape.parts) != [0]:
self.AddError("Multipart features are not supported in sDNA: convert your input data to single part features then rerun")
Expand Down

0 comments on commit e8874aa

Please sign in to comment.