Skip to content

Commit 6a60d20

Browse files
committed
BUGFIX: Detect response.status_code != 200 errors while downloading apm.pdef.xml files
1 parent d27dda0 commit 6a60d20

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

MethodicConfigurator/annotate_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ def get_xml_data(base_url: str, directory: str, filename: str) -> ET.Element:
331331
try:
332332
# Send a GET request to the URL
333333
response = requests_get(base_url + filename, timeout=5)
334+
if response.status_code != 200:
335+
logging.critical("Remote URL: %s", base_url + filename)
336+
raise requests_exceptions.RequestException(f"HTTP status code {response.status_code}")
334337
except requests_exceptions.RequestException as e:
335338
logging.critical("Unable to fetch XML data: %s", e)
336339
raise SystemExit("unable to fetch online XML documentation") from e

0 commit comments

Comments
 (0)