From c7bbf99c59be8854a94a7e6976f94d169b428bb9 Mon Sep 17 00:00:00 2001 From: gavinhgchen Date: Mon, 20 Jun 2022 14:27:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0URISyntaxException=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=BF=A1=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/http_sender.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/http_sender.cpp b/src/util/http_sender.cpp index ea29f29..baf3c7e 100644 --- a/src/util/http_sender.cpp +++ b/src/util/http_sender.cpp @@ -275,6 +275,10 @@ int HttpSender::SendRequest( SDK_LOG_INFO("Request canceled by user"); *err_msg = "Request canceled by user"; return -1; + } catch (Poco::URISyntaxException& ex) { + SDK_LOG_ERR("url:%s URISyntaxException:%s", url_str.c_str(), ex.displayText().c_str()); + *err_msg = "url:" + url_str + " URISyntaxException:" + ex.displayText(); + return -1; } catch (const std::exception& ex) { SDK_LOG_ERR("Exception:%s, errno=%d", std::string(ex.what()).c_str(), errno); @@ -492,6 +496,10 @@ int HttpSender::SendRequest( SDK_LOG_INFO("Request canceled by user"); *err_msg = "Request canceled by user"; return -1; + } catch (Poco::URISyntaxException& ex) { + SDK_LOG_ERR("url:%s URISyntaxException:%s", url_str.c_str(), ex.displayText().c_str()); + *err_msg = "url:" + url_str + " URISyntaxException:" + ex.displayText(); + return -1; } catch (const std::exception& ex) { SDK_LOG_ERR("Exception:%s, errno=%d", std::string(ex.what()).c_str(), errno);