mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
Add decode_err! to help with formatted decode error generation
This commit is contained in:
parent
24d62dd464
commit
9973fa6357
@ -236,6 +236,17 @@ macro_rules! impl_fmt_error {
|
||||
};
|
||||
}
|
||||
|
||||
#[allow(unused_macros)]
|
||||
macro_rules! decode_err {
|
||||
($s:literal, $($args:tt)*) => {
|
||||
crate::Error::Decode(format!($s, $($args)*).into())
|
||||
};
|
||||
|
||||
($expr:expr) => {
|
||||
crate::Error::decode($expr)
|
||||
};
|
||||
}
|
||||
|
||||
/// An unexpected `NULL` was encountered during decoding.
|
||||
///
|
||||
/// Returned from `Row::get` if the value from the database is `NULL`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user