mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-23 01:32:25 +02:00
Add better error messages
This commit is contained in:
parent
6f528e8330
commit
1890cc8f26
2 changed files with 27 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
import os
|
||||
import sys
|
||||
import csv
|
||||
import logging
|
||||
|
@ -426,6 +427,22 @@ class Command(BaseCommand):
|
|||
# print message to terminal about which args are in use
|
||||
self.print_debug_mode_statements(debug_on, debug_max_entries_to_parse)
|
||||
|
||||
filenames = [
|
||||
agency_adhoc_filename,
|
||||
domain_adhoc_filename,
|
||||
organization_adhoc_filename,
|
||||
domain_escrow_filename,
|
||||
domain_additional_filename,
|
||||
]
|
||||
|
||||
# Do a top-level check to see if these files exist
|
||||
for filename in filenames:
|
||||
if not isinstance(filename, str):
|
||||
raise TypeError(f"Filename must be a string, got {type(filename).__name__}")
|
||||
full_path = os.path.join(directory, filename)
|
||||
if not os.path.isfile(full_path):
|
||||
raise FileNotFoundError(full_path)
|
||||
|
||||
# STEP 1:
|
||||
# Create mapping of domain name -> status
|
||||
domain_status_dictionary = self.get_domain_user_dict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue