From d95fa771f5c9a75dece2038ee50619a53f9c43f7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 29 Dec 2018 00:07:14 -0800 Subject: check request status codes idiomatically --- python/fatcat_tools/workers/elasticsearch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/fatcat_tools/workers') diff --git a/python/fatcat_tools/workers/elasticsearch.py b/python/fatcat_tools/workers/elasticsearch.py index e7abd5ee..3adb088e 100644 --- a/python/fatcat_tools/workers/elasticsearch.py +++ b/python/fatcat_tools/workers/elasticsearch.py @@ -48,5 +48,5 @@ class ElasticsearchReleaseWorker(FatcatWorker): release.ident) print("Updating document: {}".format(elasticsearch_endpoint)) resp = requests.post(elasticsearch_endpoint, json=release_to_elasticsearch(release)) - assert resp.status_code in (200, 201) + resp.raise_for_status() #consumer.commit_offsets() -- cgit v1.2.3