Use urllib.error.HTTPError Could fix #351, since 'None' (nothing) used to be returned and the error was: TypeError: 'NoneType' object is not subscriptable