mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-20 09:04:10 +00:00
chore(postgres): include nullables query in error
This commit is contained in:
@@ -312,11 +312,16 @@ impl From<crate::migrate::MigrateError> for Error {
|
||||
/// Format an error message as a `Protocol` error
|
||||
#[macro_export]
|
||||
macro_rules! err_protocol {
|
||||
($expr:expr) => {
|
||||
$crate::error::Error::Protocol($expr.into())
|
||||
};
|
||||
|
||||
($fmt:expr, $($arg:tt)*) => {
|
||||
$crate::error::Error::Protocol(format!($fmt, $($arg)*))
|
||||
($($fmt_args:tt)*) => {
|
||||
$crate::error::Error::Protocol(
|
||||
format!(
|
||||
"{} ({}:{})",
|
||||
// Note: the format string needs to be unmodified (e.g. by `concat!()`)
|
||||
// for implicit formatting arguments to work
|
||||
format_args!($($fmt_args)*),
|
||||
module_path!(),
|
||||
line!(),
|
||||
)
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user