This is an automated email from the ASF dual-hosted git repository. gavinchou pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit cf156514432d8ec172a8cd18db80f258ee35efd6 Author: AlexYue <yj976240...@gmail.com> AuthorDate: Thu Jul 4 20:49:11 2024 +0800 [enhance](Recycler) Catch RequestFailedException for all azure request (#37298) Previously we only catch storageException for azure's request. But it could also throw RequestFailedException which is the base class for storageException. So we directly catch RequestFailedException here. --- cloud/src/recycler/azure_obj_client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cloud/src/recycler/azure_obj_client.cpp b/cloud/src/recycler/azure_obj_client.cpp index 62386808d08..abdea9d4d8f 100644 --- a/cloud/src/recycler/azure_obj_client.cpp +++ b/cloud/src/recycler/azure_obj_client.cpp @@ -45,13 +45,18 @@ template <typename Func> ObjectStorageResponse do_azure_client_call(Func f, std::string_view url, std::string_view key) { try { f(); - } catch (Azure::Storage::StorageException& e) { + } catch (Azure::Core::RequestFailedException& e) { auto msg = fmt::format( "Azure request failed because {}, http_code: {}, request_id: {}, url: {}, " "key: {}", e.Message, static_cast<int>(e.StatusCode), e.RequestId, url, key); LOG_WARNING(msg); return {-1, std::move(msg)}; + } catch (std::exception& e) { + auto msg = fmt::format("Azure request failed because {}, url: {}, key: {}", e.what(), url, + key); + LOG_WARNING(msg); + return {-1, std::move(msg)}; } return {}; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org