From 6a421d3b787078be3fce5720ceeb4bcd690ff97a Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Tue, 12 May 2020 06:34:21 -0700 Subject: [PATCH] Add checking for 404 errors that aborts create project (#1183) My apologies. I fixed my version, then added the code in your __init__.py to loop and wait for the not found error to disappear. By then, however, the error stopped occurring and I didn't notice that errors.py wasn't recognizing the error. --- src/gam/gapi/errors.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gam/gapi/errors.py b/src/gam/gapi/errors.py index 2085b956..9a985aa9 100644 --- a/src/gam/gapi/errors.py +++ b/src/gam/gapi/errors.py @@ -328,6 +328,10 @@ def get_gapi_error_detail(e, message = error['error']['errors'][0]['message'] except KeyError: message = error['error']['message'] + if http_status == 404: + if 'Requested entity was not found' in message or 'does not exist' in message: + error = _create_http_error_dict(404, ErrorReason.NOT_FOUND.value, + message) else: if 'error_description' in error: if error['error_description'] == 'Invalid Value':