Skip to content

Commit 8a65088

Browse files
authored
fix: retry on error of response.bytes() (#750)
refactor: 1. fix retry. 1. add api_type, query_id, retry times in error context.
1 parent 1067a5e commit 8a65088

7 files changed

Lines changed: 869 additions & 294 deletions

File tree

bindings/python/src/exceptions.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,8 @@ fn map_api_error_to_exception(api_error: &databend_client::Error, error_msg: Str
321321
databend_client::Error::AuthFailure(_) => OperationalError::new_err(error_msg),
322322

323323
// Wrapped errors - unwrap and recurse
324-
databend_client::Error::WithContext(inner_error, context) => {
325-
let inner_err = map_api_error_to_exception(inner_error, inner_error.to_string());
326-
let context_msg = format!("{}: {}", context, inner_err);
327-
328-
// Return a DatabaseError with context message to simplify the logic
329-
// The original error classification is preserved in the context
330-
DatabaseError::new_err(context_msg)
324+
databend_client::Error::WithContext { inner, .. } => {
325+
map_api_error_to_exception(inner, error_msg)
331326
}
332327
}
333328
}

0 commit comments

Comments
 (0)