generate-integration-docs-screenshot: Message to run dev server.

If the dev server is not running, when this tool is run, we print a clear
error message to start the dev server first, and then run this tool.
This commit is contained in:
Puneeth Chaganti
2020-04-17 14:26:08 +05:30
committed by Tim Abbott
parent 874e473fc4
commit ae754887eb

View File

@@ -102,7 +102,12 @@ def send_bot_payload_message(bot: UserProfile, integration: WebhookIntegration,
data = ujson.load(f)
_, fixture_name = split_fixture_path(fixture_path)
headers = get_requests_headers(integration.name, fixture_name)
response = requests.post(url, json=data, headers=headers)
try:
response = requests.post(url, json=data, headers=headers)
except requests.exceptions.ConnectionError:
print('This tool needs the local dev server to be running. '
'Please start it using tools/run-dev.py before running this tool.')
sys.exit(1)
if response.status_code != 200:
print(response.json())
print('Failed to trigger webhook')