History

Nick: working

Nicolas committed 2 years ago

Commit ade4e051 parent bfccaf65 files · +181 −105Browse files

Showing the changes to apps/python-sdk (1 of 5 files). Show all

Unified · Split

apps/python-sdk/firecrawl/firecrawl.py+2−2
@@ -48,7 +48,7 @@ class FirecrawlApp: · 47 unmodified lines
4848 return response['data']
4949 else:
5050 raise Exception(f'Failed to scrape URL. Error: {response["error"]}')
51− elif response.status_code in [402, 409, 500]:
51+ elif response.status_code in [402, 408, 409, 500]:
5252 error_message = response.json().get('error', 'Unknown error occurred')
5353 raise Exception(f'Failed to scrape URL. Status code: {response.status_code}. Error: {error_message}')
5454 else:
@@ -148,7 +148,7 @@ class FirecrawlApp: · 93 unmodified lines
148148 self._handle_error(status_response, 'check crawl status')
149149
150150 def _handle_error(self, response, action):
151− if response.status_code in [402, 409, 500]:
151+ if response.status_code in [402, 408, 409, 500]:
152152 error_message = response.json().get('error', 'Unknown error occurred')
153153 raise Exception(f'Failed to {action}. Status code: {response.status_code}. Error: {error_message}')
154154 else: