From 452bd68aa30939cd7b2a9f0a82ce80c4156ac3f4 Mon Sep 17 00:00:00 2001 From: kevinpricethesecond Date: Tue, 5 Nov 2024 11:10:06 -0600 Subject: [PATCH] working --- CHANGELOG.md | 9 ++------- service/utils.py | 7 ++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28279a7..3e7f87c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -1.7.0 +1.7.1 Live-docs: https://tapis-project.github.io/live-docs/?service=GlobusProxy @@ -9,9 +9,4 @@ New features: - none Bug fixes: - - fixed incorrect error code when globus errors happen while making a transfer - - fixed formatting of error logs - - fixed 400 error on GET when a content-type header is included - - added additional tenant - - better error messages for uncaught exceptions - - change schema to allow for larger file sizes + - fixed incorrect error code when performing operations on an endpoint/collection that has been deleted diff --git a/service/utils.py b/service/utils.py index 6a5899d..1906a75 100644 --- a/service/utils.py +++ b/service/utils.py @@ -226,6 +226,8 @@ def handle_transfer_error(exception, endpoint_id=None, msg=None): error = GlobusInvalidRequestError(msg=message) if exception.code == 404: error = EndpointNotFoundError(msg=exception.message) + if exception.code == 'EndpointDeleted': + error = EndpointNotFoundError(msg=exception.message) logger.error(error) return error @@ -331,7 +333,10 @@ def precheck(client_id, endpoints, access_token, refresh_token): endpoints = list(endpoints.split()) logger.debug(f'have ep list:: {endpoints}') for endpoint_id in endpoints: - endpoint_info = transfer_client.get_endpoint(endpoint_id) + try: + endpoint_info = transfer_client.get_endpoint(endpoint_id) + except TransferAPIError as e: + raise handle_transfer_error(e) endpoint_type = endpoint_info["entity_type"] if endpoint_type == "GCP_mapped_collection": # if it's a globus connect personal ep connected = is_endpoint_connected(transfer_client, endpoint_id)