Fix matching RPC errors by string
Fix matching RPC errors by string:
/// Temporary solution until proc_cas returns structured errors
#[inline(always)]
pub fn is_cas_err(&self) -> bool {
self.to_string().contains("compare-and-swap")
}
/// Temporary solution until proc_cas returns structured errors
#[inline(always)]
pub fn is_term_mismatch_err(&self) -> bool {
self.to_string()
.contains("operation request from different term")
}
/// Temporary solution until proc_cas returns structured errors
#[inline(always)]
pub fn is_not_leader_err(&self) -> bool {
self.to_string().contains("not a leader")
}
They should be structured errors or error codes