Skip to content

Commit 738e509

Browse files
committed
feat: add method to indicate if error is retriable
1 parent a49c005 commit 738e509

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

src/error.rs

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,6 @@ pub enum Error {
3838
#[snafu(display("Unknown proto column datatype: {}", datatype))]
3939
UnknownColumnDataType { datatype: i32, location: Location },
4040

41-
// #[snafu(display("Failed to create column datatype from {:?}", from))]
42-
// IntoColumnDataType {
43-
// from: ConcreteDataType,
44-
// location: Location,
45-
// },
46-
47-
// #[snafu(display(
48-
// "Failed to convert column default constraint, column: {}, source: {}",
49-
// column,
50-
// source
51-
// ))]
52-
// ConvertColumnDefaultConstraint {
53-
// column: String,
54-
// #[snafu(backtrace)]
55-
// source: datatypes::error::Error,
56-
// },
57-
58-
// #[snafu(display(
59-
// "Invalid column default constraint, column: {}, source: {}",
60-
// column,
61-
// source
62-
// ))]
63-
// InvalidColumnDefaultConstraint {
64-
// column: String,
65-
// #[snafu(backtrace)]
66-
// source: datatypes::error::Error,
67-
// },
6841
#[snafu(display("Illegal GRPC client state: {}", err_msg))]
6942
IllegalGrpcClientState { err_msg: String, location: Location },
7043

@@ -99,3 +72,15 @@ impl From<Status> for Error {
9972
Self::Server { status: e, msg }
10073
}
10174
}
75+
76+
impl Error {
77+
/// Indicate if the error is retriable
78+
pub fn is_retriable(&self) -> bool {
79+
!matches!(
80+
self,
81+
Self::InvalidTlsConfig { .. }
82+
| Self::MissingField { .. }
83+
| Self::InvalidConfigFilePath { .. }
84+
)
85+
}
86+
}

0 commit comments

Comments
 (0)