mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 13:15:54 +08:00
fix/missing error in response
This commit is contained in:
parent
6ebfcc85cf
commit
18f69c90b1
@ -81,8 +81,10 @@ class FirecrawlApp:
|
|||||||
response = response.json()
|
response = response.json()
|
||||||
if response['success'] and 'data' in response:
|
if response['success'] and 'data' in response:
|
||||||
return response['data']
|
return response['data']
|
||||||
else:
|
elif "error" in response:
|
||||||
raise Exception(f'Failed to scrape URL. Error: {response["error"]}')
|
raise Exception(f'Failed to scrape URL. Error: {response["error"]}')
|
||||||
|
else:
|
||||||
|
raise Exception(f'Failed to scrape URL. Error: {response}')
|
||||||
else:
|
else:
|
||||||
self._handle_error(response, 'scrape URL')
|
self._handle_error(response, 'scrape URL')
|
||||||
|
|
||||||
@ -266,8 +268,10 @@ class FirecrawlApp:
|
|||||||
response = response.json()
|
response = response.json()
|
||||||
if response['success'] and 'links' in response:
|
if response['success'] and 'links' in response:
|
||||||
return response
|
return response
|
||||||
else:
|
elif 'error' in response:
|
||||||
raise Exception(f'Failed to map URL. Error: {response["error"]}')
|
raise Exception(f'Failed to map URL. Error: {response["error"]}')
|
||||||
|
else:
|
||||||
|
raise Exception(f'Failed to map URL. Error: {response}')
|
||||||
else:
|
else:
|
||||||
self._handle_error(response, 'map')
|
self._handle_error(response, 'map')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user