We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7da21e1 commit 427fc34Copy full SHA for 427fc34
tokio-postgres/src/error/mod.rs
@@ -336,8 +336,8 @@ pub enum ErrorPosition {
336
},
337
}
338
339
-#[derive(Debug, PartialEq)]
340
-enum Kind {
+#[derive(Debug, PartialEq, Clone)]
+pub enum Kind {
341
Io,
342
UnexpectedMessage,
343
Tls,
@@ -428,6 +428,10 @@ impl Error {
428
self.as_db_error().map(DbError::code)
429
430
431
+ pub fn kind(&self) -> Kind {
432
+ self.0.kind.clone()
433
+ }
434
+
435
fn new(kind: Kind, cause: Option<Box<dyn error::Error + Sync + Send>>) -> Error {
436
Error(Box::new(ErrorInner { kind, cause }))
437
0 commit comments