MatteoScript commited on
Commit
7718a42
·
verified ·
1 Parent(s): 163745b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -208,9 +208,9 @@ async def make_request(session, token, data, url, index, semaphore, max_retries=
208
  except aiohttp.ContentTypeError:
209
  result_data = await response.text()
210
  return result_data
211
- except (asyncio.TimeoutError, aiohttp.ClientError) as e:
212
- LoggaTesto("ERRORE ASYNC", {str(e)}, False)
213
- if isinstance(e, aiohttp.ClientError) and e.status in [502, 504]:
214
  break
215
  await asyncio.sleep(3)
216
  raise Exception("Max retries reached or skipping retries. Unable to make the request.")
 
208
  except aiohttp.ContentTypeError:
209
  result_data = await response.text()
210
  return result_data
211
+ except (asyncio.TimeoutError, aiohttp.ClientError, requests.exceptions.HTTPError) as e:
212
+ LoggaTesto("ERRORE ASYNC", {e}, False)
213
+ if isinstance(e, (asyncio.TimeoutError, requests.exceptions.HTTPError)) and e.response.status in [502, 504]:
214
  break
215
  await asyncio.sleep(3)
216
  raise Exception("Max retries reached or skipping retries. Unable to make the request.")