Skip to content

Commit f1a7611

Browse files
authored
Merge pull request #23 from ScrapingAnt/feature/fix-readme-retries-example
feature/fix-readme-retries-example: done
2 parents 0a9cb5d + 2f17cd7 commit f1a7611

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff 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

143143
client = 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:

0 commit comments

Comments
 (0)