From 3fd1ad6e824daa13278cab7405aa4e1f85bd7eea Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 22 Oct 2024 16:00:46 +0800 Subject: [PATCH] az/delete: catch all cpp exceptions --- source/libs/azure/src/az.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/libs/azure/src/az.cpp b/source/libs/azure/src/az.cpp index 1d693a6a32..831694356a 100644 --- a/source/libs/azure/src/az.cpp +++ b/source/libs/azure/src/az.cpp @@ -348,7 +348,7 @@ int32_t azGetObjectBlock(const char *object_name, int64_t offset, int64_t size, TAOS_RETURN(code); } -void azDeleteObjectsByPrefix(const char *prefix) { +static void azDeleteObjectsByPrefixImpl(const char *prefix) { const std::string delimiter = "/"; std::string accountName = tsS3AccessKeyId[0]; std::string accountKey = tsS3AccessKeySecret[0]; @@ -380,7 +380,16 @@ void azDeleteObjectsByPrefix(const char *prefix) { } catch (const Azure::Core::RequestFailedException &e) { azError("%s failed at line %d since %d(%s)", __func__, __LINE__, static_cast(e.StatusCode), e.ReasonPhrase.c_str()); - // azError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(TAOS_SYSTEM_ERROR(EIO))); + } +} + +void azDeleteObjectsByPrefix(const char *prefix) { + int32_t code = TSDB_CODE_SUCCESS; + + try { + azDeleteObjectsByPrefixImpl(prefix); + } catch (const std::exception &e) { + azError("%s: Reason Phrase: %s", __func__, e.what()); } }