dataroaring commented on code in PR #48965:
URL: https://github.com/apache/doris/pull/48965#discussion_r2000041403


##########
be/src/exec/es/es_scan_reader.cpp:
##########
@@ -75,7 +75,16 @@ ESScanReader::ESScanReader(const std::string& target,
             _doc_value_mode ? DOCVALUE_SCROLL_SEARCH_FILTER_PATH : 
SOURCE_SCROLL_SEARCH_FILTER_PATH;
 
     // When shard_id is negative(-1), the request will be sent to ES without 
shard preference.
-    int32 shard_id = std::stoi(_shards);
+    int32 shard_id;
+    try {
+        shard_id = std::stoi(_shards);
+    } catch (std::invalid_argument& e) {
+        LOG(WARNING) << fmt::format("Invalid shard_id format: {}, error: {}", 
_shards, e.what());
+    } catch (std::out_of_range& e) {
+        LOG(WARNING) << fmt::format("Shard_id value out of range: {}, error: 
{}", _shards,
+                                    e.what());

Review Comment:
   set shard_id = -1 ?



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to