Skip to content

Commit 6accd83

Browse files
Merge pull request #108 from chen-honggang/dev/uri-exception
增加URISyntaxException异常信息处理
2 parents 601be03 + c7bbf99 commit 6accd83

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/util/http_sender.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ int HttpSender::SendRequest(
275275
SDK_LOG_INFO("Request canceled by user");
276276
*err_msg = "Request canceled by user";
277277
return -1;
278+
} catch (Poco::URISyntaxException& ex) {
279+
SDK_LOG_ERR("url:%s URISyntaxException:%s", url_str.c_str(), ex.displayText().c_str());
280+
*err_msg = "url:" + url_str + " URISyntaxException:" + ex.displayText();
281+
return -1;
278282
} catch (const std::exception& ex) {
279283
SDK_LOG_ERR("Exception:%s, errno=%d", std::string(ex.what()).c_str(),
280284
errno);
@@ -492,6 +496,10 @@ int HttpSender::SendRequest(
492496
SDK_LOG_INFO("Request canceled by user");
493497
*err_msg = "Request canceled by user";
494498
return -1;
499+
} catch (Poco::URISyntaxException& ex) {
500+
SDK_LOG_ERR("url:%s URISyntaxException:%s", url_str.c_str(), ex.displayText().c_str());
501+
*err_msg = "url:" + url_str + " URISyntaxException:" + ex.displayText();
502+
return -1;
495503
} catch (const std::exception& ex) {
496504
SDK_LOG_ERR("Exception:%s, errno=%d", std::string(ex.what()).c_str(),
497505
errno);

0 commit comments

Comments
 (0)