File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ print(result.content)
138138### Exception handling and retries
139139
140140``` python
141- from scrapingant_client import ScrapingAntClient, ScrapingantClientException
141+ from scrapingant_client import ScrapingAntClient, ScrapingantClientException, ScrapingantInvalidInputException
142142
143143client = ScrapingAntClient(token = ' <YOUR-SCRAPINGANT-API-TOKEN>' )
144144
@@ -153,6 +153,9 @@ for retry_number in range(RETRIES_COUNT):
153153 scrapingant_response = client.general_request(
154154 ' https://example.com' ,
155155 )
156+ except ScrapingantInvalidInputException as e:
157+ print (f ' Got invalid input exception: {{ repr(e) }} ' )
158+ break # We are not retrying if request params are not valid
156159 except ScrapingantClientException as e:
157160 print (f ' Got ScrapingAnt exception { repr (e)} ' )
158161 except Exception as e:
You can’t perform that action at this time.
0 commit comments