File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -770,7 +770,8 @@ impl Catalog for RestCatalog {
770770 return Err ( Error :: new (
771771 ErrorKind :: Unexpected ,
772772 "CommitFailedException, one or more requirements failed. The client may retry." ,
773- ) ) ;
773+ )
774+ . with_retryable ( true ) ) ;
774775 }
775776 StatusCode :: INTERNAL_SERVER_ERROR => {
776777 return Err ( Error :: new (
Original file line number Diff line number Diff line change @@ -134,6 +134,8 @@ pub struct Error {
134134
135135 source : Option < anyhow:: Error > ,
136136 backtrace : Backtrace ,
137+
138+ retryable : bool ,
137139}
138140
139141impl Display for Error {
@@ -225,9 +227,17 @@ impl Error {
225227 // `Backtrace::capture()` will check if backtrace has been enabled
226228 // internally. It's zero cost if backtrace is disabled.
227229 backtrace : Backtrace :: capture ( ) ,
230+
231+ retryable : false ,
228232 }
229233 }
230234
235+ /// Set retryable of the error.
236+ pub fn with_retryable ( mut self , retryable : bool ) -> Self {
237+ self . retryable = retryable;
238+ self
239+ }
240+
231241 /// Add more context in error.
232242 pub fn with_context ( mut self , key : & ' static str , value : impl Into < String > ) -> Self {
233243 self . context . push ( ( key, value. into ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments