dataroaring commented on code in PR #48965:
URL: https://github.com/apache/doris/pull/48965#discussion_r2000046929
##########
be/src/olap/data_dir.cpp:
##########
@@ -85,7 +85,13 @@ Status read_cluster_id(const std::string& cluster_id_path,
int32_t* cluster_id)
size_t bytes_read = 0;
RETURN_IF_ERROR(reader->read_at(0, {content.data(), fsize},
&bytes_read));
DCHECK_EQ(fsize, bytes_read);
- *cluster_id = std::stoi(content);
+ try {
+ *cluster_id = std::stoi(content);
+ } catch (std::invalid_argument&) {
+ LOG(WARNING) << "Invalid cluster_id value: " << content;
+ } catch (std::out_of_range&) {
+ LOG(WARNING) << "cluster_id value out of range: " << content;
Review Comment:
just return an errror.
--
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]