[Datasheet dowload] Catch requests.exceptions.TooManyRedirects

Closes #408
This commit is contained in:
Salvador E. Tropea 2023-03-27 08:22:39 -03:00
parent 786c94a80c
commit f7d52f3d09
2 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `default_resistor_tolerance` which tolerance to use when none found.
- `cache_3d_resistors` to avoid generating them all the time.
- 3D: colored 3D models for THT resistors
- Datasheet download:
- Avoid interruptions when too many redirections is detected (#408)
### Fixed
- Makefile: don't skip all preflights on each run, just the ones we generate

View File

@ -75,6 +75,9 @@ class Download_Datasheets_Options(VariantOptions):
except requests.exceptions.SSLError:
logger.warning(W_FAILDL+'SSL Error during download `{}`'.format(ds))
return None
except requests.exceptions.TooManyRedirects:
logger.warning(W_FAILDL+'More than 30 redirections downloading `{}`'.format(ds))
return None
if r.status_code != 200:
logger.warning(W_FAILDL+'Failed to download `{}`'.format(ds))
return None