Commit
·
ac4cb23
1
Parent(s):
4a61d23
Fix 404 handling
Browse files- challenge-cli.py +7 -9
challenge-cli.py
CHANGED
|
@@ -7,8 +7,9 @@ from datetime import datetime, timedelta, timezone
|
|
| 7 |
from pathlib import Path
|
| 8 |
|
| 9 |
import click
|
|
|
|
| 10 |
|
| 11 |
-
from dyff.client import Client
|
| 12 |
from dyff.schema.platform import *
|
| 13 |
from dyff.schema.requests import *
|
| 14 |
|
|
@@ -28,14 +29,11 @@ def _wait_for_status(
|
|
| 28 |
status = get_entity_fn().status
|
| 29 |
if status in target_status:
|
| 30 |
return status
|
| 31 |
-
except
|
| 32 |
-
if
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
if ex.status_code != 404: # pyright: ignore
|
| 37 |
-
raise
|
| 38 |
-
else:
|
| 39 |
raise
|
| 40 |
if (datetime.now(timezone.utc) - then) >= timeout:
|
| 41 |
break
|
|
|
|
| 7 |
from pathlib import Path
|
| 8 |
|
| 9 |
import click
|
| 10 |
+
import httpx
|
| 11 |
|
| 12 |
+
from dyff.client import Client, errors
|
| 13 |
from dyff.schema.platform import *
|
| 14 |
from dyff.schema.requests import *
|
| 15 |
|
|
|
|
| 29 |
status = get_entity_fn().status
|
| 30 |
if status in target_status:
|
| 31 |
return status
|
| 32 |
+
except errors.HTTPError as ex:
|
| 33 |
+
if ex.status != 404:
|
| 34 |
+
raise
|
| 35 |
+
except httpx.HTTPStatusError as ex:
|
| 36 |
+
if ex.response.status_code != 404:
|
|
|
|
|
|
|
|
|
|
| 37 |
raise
|
| 38 |
if (datetime.now(timezone.utc) - then) >= timeout:
|
| 39 |
break
|