Skip to content

Commit 7be19b8

Browse files
Use existing error::is_retriable_error
1 parent f08b2a7 commit 7be19b8

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

crates/fluss/src/client/lookup/lookup_sender.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -392,25 +392,14 @@ impl LookupSender {
392392
}
393393
Err(e) => {
394394
let err_msg = format!("Lookup request failed: {}", e);
395-
let is_retriable = Self::is_retriable_error(&e);
395+
let is_retriable = e.is_retriable();
396396
for batch in &mut batches {
397397
self.handle_lookup_error(&err_msg, is_retriable, batch);
398398
}
399399
}
400400
}
401401
}
402402

403-
/// Checks if an error is retriable.
404-
fn is_retriable_error(error: &Error) -> bool {
405-
match error {
406-
Error::FlussAPIError { api_error } => {
407-
let fluss_error = FlussError::for_code(api_error.code);
408-
fluss_error.is_retriable()
409-
}
410-
_ => false,
411-
}
412-
}
413-
414403
/// Handles the lookup response.
415404
fn handle_lookup_response(
416405
&self,

0 commit comments

Comments
 (0)