Skip to content

Commit 7728d37

Browse files
authored
fix: mention status code before node ids in exception message (#88)
This should make it a bit easier to read since `nids` is an array of up to 50 numbers so currently we get messages like: ``` Exception: unexpected response when fetching nodes ['1301730', '2999525', '2980066', '3263534', '3415185', '73594', '258223', '2942788', '3046066', '3145765', '1699634', '2425017', '2345891', '1762004', '2956120', '2649868', '1404150', '61442', '2684717', '632214', '225194', '1934188', '1883798', '607826', '173525', '436148', '2348769', '1408882', '20492', '925500', '147151', '2906646', '2579037', '259843', '1087226', '1302522', '2365459', '3066563', '3245777', '2788489', '3152933', '2705191', '169791', '1509408', '2846636', '19304', '3261896', '2887155', '3228985', '1909836']: 429 ``` Whereas now we'll get: ``` Exception: unexpected 429 response when fetching nodes ['1301730', '2999525', '2980066', '3263534', '3415185', '73594', '258223', '2942788', '3046066', '3145765', '1699634', '2425017', '2345891', '1762004', '2956120', '2649868', '1404150', '61442', '2684717', '632214', '225194', '1934188', '1883798', '607826', '173525', '436148', '2348769', '1408882', '20492', '925500', '147151', '2906646', '2579037', '259843', '1087226', '1302522', '2365459', '3066563', '3245777', '2788489', '3152933', '2705191', '169791', '1509408', '2846636', '19304', '3261896', '2887155', '3228985', '1909836'] ```
1 parent a7a3488 commit 7728d37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/precache_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def fetch_drupal_nodes(nids: list[str]) -> list[drupal.Node]:
3333
if len(items) != len(nids):
3434
raise Exception(f'API returned {len(items)} nodes but expected {len(nids)}')
3535
return items
36-
raise Exception(f'unexpected response when fetching nodes {nids}: {resp.status_code}')
36+
raise Exception(f'unexpected {resp.status_code} response when fetching nodes {nids}')
3737

3838

3939
def fetch_and_cache_drupal_nodes() -> None:

0 commit comments

Comments
 (0)