[Repository] Add better error message (#993)
* [Repository] Add better error message
* Update src/huggingface_hub/repository.py
* Apply suggestions from wauplin and pierric
* add docstring
* Update src/huggingface_hub/repository.py
* Update src/huggingface_hub/repository.py
* refacto docstring hoping the doc generation will pass
Co-authored-by: Lucain <lucainp@gmail.com>