Created
January 28, 2015 18:32
-
-
Save migurski/4929eec266980309458e to your computer and use it in GitHub Desktop.
guess reason for OpenAddresses failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def guess_reason(log): | |
''' | |
''' | |
if 'JobTimeoutException' in log: | |
return 'took too long' | |
elif 'DownloadError: 404 response' in log: | |
return 'missing source' | |
elif 'Source says to skip' in log: | |
return 'skipped' | |
elif 'Invalid number of points in LinearRing' in log: | |
return 'invalid geometry' | |
elif 'Problem querying ESRI field names' in log: | |
return 'bad Esri metadata' | |
elif 'File "/usr/local/lib/python2.7/dist-packages/openaddr/cache.py", line 320' in log: | |
return 'bad Esri metadata' | |
elif 'File "/usr/local/lib/python2.7/dist-packages/openaddr/cache.py", line 400' in log: | |
return 'bad Esri data' | |
elif 'File "/usr/local/lib/python2.7/dist-packages/openaddr/cache.py", line 261' in log: | |
return 'bad Esri geometry' | |
elif 'File "/usr/local/lib/python2.7/dist-packages/openaddr/conform.py", line 588' in log: | |
return 'incorrect conform' | |
elif 'File "/usr/local/lib/python2.7/dist-packages/openaddr/cache.py", line 137' in log: | |
return 'unknown file extension' | |
elif 'Max retries exceeded with url:' in log: | |
return 'exceeded request limit' | |
elif "cannot concatenate 'str' and 'NoneType' objects" in log: | |
return 'unknown content-type' | |
elif 'Source says to skip' in log: | |
return 'skipped' | |
else: | |
return '?' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment