mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
feat(mysql): thread E: Execute through the executor
+ handle normal errors separate from unexpected errors, an unexpected error causes the connection to close (in which case, if this was behind a pool, the pool would not allow this connection to be acquired again)
This commit is contained in:
@@ -30,6 +30,8 @@ pub enum Error {
|
||||
///
|
||||
RowNotFound,
|
||||
|
||||
Closed,
|
||||
|
||||
Decode(DecodeError),
|
||||
|
||||
Encode(EncodeError),
|
||||
@@ -82,6 +84,8 @@ impl Display for Error {
|
||||
f.write_str("no row returned by a query required to return at least one row")
|
||||
}
|
||||
|
||||
Self::Closed => f.write_str("connection or pool was closed"),
|
||||
|
||||
Self::Decode(error) => {
|
||||
write!(f, "{}", error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user