generate-integration-docs-screenshot: Raise ArgumentTypeError.

When an invalid fixture is passed as an argument to the tool, raise an
`ArgumentTypeError`, instead of a `ValueError`.
This commit is contained in:
Puneeth Chaganti 2020-04-17 14:49:54 +05:30 committed by Tim Abbott
parent ae754887eb
commit cee240fb74
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ def get_requests_headers(integration_name: str, fixture_name: str) -> Dict[str,
def webhook_json_fixture(path: str) -> str:
path = os.path.abspath(path)
if not (os.path.exists(path) and path.endswith('.json') and 'webhooks' in path):
raise ValueError('Not a valid webhook JSON fixture')
raise argparse.ArgumentTypeError('Not a valid webhook JSON fixture')
return path
def send_bot_payload_message(bot: UserProfile, integration: WebhookIntegration, fixture_path: str) -> None: