chore: modify not_enough_available_datanodes error msg (#42)
This commit is contained in:
+4
-5
@@ -101,18 +101,17 @@ impl ResponseHeader {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum ErrorCode {
|
pub enum ErrorCode {
|
||||||
NotEnoughActiveDatanodes = 1,
|
NotEnoughAvailableDatanodes = 1,
|
||||||
NotLeader = 2,
|
NotLeader = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Error {
|
impl Error {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn not_enough_active_datanodes(datanode_num: u32) -> Self {
|
pub fn not_enough_available_datanodes(expected: usize, actual: usize) -> Self {
|
||||||
Self {
|
Self {
|
||||||
code: ErrorCode::NotEnoughActiveDatanodes as i32,
|
code: ErrorCode::NotEnoughAvailableDatanodes as i32,
|
||||||
err_msg: format!(
|
err_msg: format!(
|
||||||
"There are not enough active datanodes, the number is {}.",
|
"There are not enough active datanodes, expected: {expected}, actual: {actual}."
|
||||||
datanode_num
|
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user