Skip to content

Commit

Permalink
Merge pull request #5 from UDST/exceptions
Browse files Browse the repository at this point in the history
Remove unnecessary log statements and replace broad Exceptions
  • Loading branch information
sablanchard authored Apr 6, 2017
2 parents 1a27556 + 71aba72 commit 3181c64
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions osmnet/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None,
for json in response_jsons_list:
try:
response_jsons.extend(json['elements'])
except Exception:
log('Exception while stitching individual JSON results.')
except KeyError:
pass

# remove duplicate records resulting from the json stitching
Expand Down Expand Up @@ -711,8 +710,7 @@ def pairwise(l):
for tag in config.settings.keep_osm_tags:
try:
col_dict.update({tag: row[tag]})
except Exception:
log('Exception while updating dictionary (two-way).')
except KeyError:
pass

pairs.append(col_dict)
Expand All @@ -726,9 +724,7 @@ def pairwise(l):
for tag in config.settings.keep_osm_tags:
try:
col_dict.update({tag: row[tag]})
except Exception:
log('Exception while updating dictionary '
'(one-way).')
except KeyError:
pass

pairs.append(col_dict)
Expand Down

0 comments on commit 3181c64

Please sign in to comment.