Skip to content

Commit

Permalink
better catching of null input values (reapplied following previous fix)
Browse files Browse the repository at this point in the history
(cherry picked from commit e8874aa)
  • Loading branch information
Crispin committed Feb 2, 2021
1 parent ac264c2 commit 42aade8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arcscripts/sdna_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,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 42aade8

Please sign in to comment.