diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-29 00:07:14 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-12-29 00:07:14 -0800 |
commit | d95fa771f5c9a75dece2038ee50619a53f9c43f7 (patch) | |
tree | 5126a6b0163abc748c0d3656aae73ad684fe7a80 /python/fatcat_tools/workers | |
parent | 0f7fb8806c1a39aa54d0cd051aa48478c1b1c070 (diff) | |
download | fatcat-d95fa771f5c9a75dece2038ee50619a53f9c43f7.tar.gz fatcat-d95fa771f5c9a75dece2038ee50619a53f9c43f7.zip |
check request status codes idiomatically
Diffstat (limited to 'python/fatcat_tools/workers')
-rw-r--r-- | python/fatcat_tools/workers/elasticsearch.py | 2 |
1 files changed, 1 insertions, 1 deletions
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() |