improve error messages when the download fails

This pull request addresses #48.