#[derive(strum::IntoStaticStr, strum::EnumString, Debug, Copy, Clone, Eq, PartialEq)]
pub enum Error {
ConnectionClosed,
ConnectionTimedOut,
LifetimeTimeout,
IdleTimeout,
PasswordRequired,
MissingAuthData,
AuthenticationFailed,
FailedToEncryptPassword,
InvalidPublicKey,
PublicKeyRetrievalNotAllowed,
UnsupportedAuthPlugin,
UnsupportedProtocolVersion,
LocalInfileNotSupported,
JSError,
JSTerminated,
OutOfMemory,
Overflow,
WrongNumberOfParametersProvided,
UnsupportedColumnType,
InvalidLocalInfileRequest,
InvalidAuthSwitchRequest,
InvalidQueryBinding,
InvalidResultRow,
InvalidBinaryValue,
InvalidEncodedInteger,
InvalidEncodedLength,
InvalidPrepareOKPacket,
InvalidOKPacket,
InvalidEOFPacket,
InvalidErrorPacket,
UnexpectedPacket,
ShortRead,
UnknownError,
InvalidState,
}
bun_core::impl_tag_error!(Error);
pub type AnyMySQLError = Error;
bun_core::named_error_set!(Error);
impl From<bun_core::Error> for Error {
fn from(e: bun_core::Error) -> Self {
e.name().parse().unwrap_or(Error::UnknownError)
}
}