Added a check for cases when the HTTP Error does not hold a 'reason' attribute

In such cases the script throws an error and exits without finishing further downloads