mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
refactor(mysql): raise MySqlClientError for general client-side errors
This commit is contained in:
@@ -10,7 +10,7 @@ pub enum PgClientError {
|
||||
// attempting to interpret data from postgres as UTF-8, when it should
|
||||
// be UTF-8, but for some reason (data corruption?) it is not
|
||||
NotUtf8(Utf8Error),
|
||||
UnknownAuthenticationMethod(u32),
|
||||
UnknownAuthMethod(u32),
|
||||
UnknownMessageType(u8),
|
||||
UnknownTransactionStatus(u8),
|
||||
UnknownValueFormat(i16),
|
||||
@@ -22,7 +22,7 @@ impl Display for PgClientError {
|
||||
match self {
|
||||
Self::NotUtf8(source) => write!(f, "unexpected invalid utf-8: {}", source),
|
||||
|
||||
Self::UnknownAuthenticationMethod(method) => {
|
||||
Self::UnknownAuthMethod(method) => {
|
||||
write!(f, "unknown authentication method: {}", method)
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ impl Deserialize<'_> for Authentication {
|
||||
11 => AuthenticationSaslContinue::deserialize(buf).map(Self::SaslContinue),
|
||||
12 => AuthenticationSaslFinal::deserialize(buf).map(Self::SaslFinal),
|
||||
|
||||
ty => Err(PgClientError::UnknownAuthenticationMethod(ty).into()),
|
||||
ty => Err(PgClientError::UnknownAuthMethod(ty).into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user