chore: modify no_active_datanodes error msg (#41)
* chore: modify no_active_datanodes error msg * cr
This commit is contained in:
+7
-4
@@ -101,16 +101,19 @@ impl ResponseHeader {
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum ErrorCode {
|
||||
NoActiveDatanodes = 1,
|
||||
NotEnoughActiveDatanodes = 1,
|
||||
NotLeader = 2,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
#[inline]
|
||||
pub fn no_active_datanodes() -> Self {
|
||||
pub fn not_enough_active_datanodes(datanode_num: u32) -> Self {
|
||||
Self {
|
||||
code: ErrorCode::NoActiveDatanodes as i32,
|
||||
err_msg: "No active datanodes".to_string(),
|
||||
code: ErrorCode::NotEnoughActiveDatanodes as i32,
|
||||
err_msg: format!(
|
||||
"There are not enough active datanodes, the number is {}.",
|
||||
datanode_num
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user