gavinchou commented on code in PR #48965:
URL: https://github.com/apache/doris/pull/48965#discussion_r2000079637
##########
cloud/src/meta-service/meta_service_resource.cpp:
##########
@@ -2777,13 +2777,24 @@ void
MetaServiceImpl::get_stage(google::protobuf::RpcController* controller,
// find, use it stage prefix and id
found = true;
// get from internal stage
- int idx = stoi(s.obj_info().id());
- if (idx > instance.obj_info().size() || idx < 1) {
- LOG(WARNING) << "invalid idx: " << idx;
- code = MetaServiceCode::UNDEFINED_ERR;
- msg = "impossible, id invalid";
+ try {
+ int idx = stoi(s.obj_info().id());
+ if (idx > instance.obj_info().size() || idx < 1) {
+ LOG(WARNING) << "invalid idx: " << idx;
+ code = MetaServiceCode::UNDEFINED_ERR;
+ msg = "impossible, id invalid";
+ return;
+ }
+ } catch (const std::invalid_argument& e) {
+ LOG(WARNING) << "Invalid idx format: " << s.obj_info().id()
Review Comment:
do error handling as line 2782 does when we meet exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]