File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
sqlx-postgres/src/connection Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -312,11 +312,16 @@ impl From<crate::migrate::MigrateError> for Error {
312312/// Format an error message as a `Protocol` error
313313#[ macro_export]
314314macro_rules! err_protocol {
315- ( $expr: expr) => {
316- $crate:: error:: Error :: Protocol ( $expr. into( ) )
317- } ;
318-
319- ( $fmt: expr, $( $arg: tt) * ) => {
320- $crate:: error:: Error :: Protocol ( format!( $fmt, $( $arg) * ) )
315+ ( $( $fmt_args: tt) * ) => {
316+ $crate:: error:: Error :: Protocol (
317+ format!(
318+ "{} ({}:{})" ,
319+ // Note: the format string needs to be unmodified (e.g. by `concat!()`)
320+ // for implicit formatting arguments to work
321+ format_args!( $( $fmt_args) * ) ,
322+ module_path!( ) ,
323+ line!( ) ,
324+ )
325+ )
321326 } ;
322327}
Original file line number Diff line number Diff line change @@ -466,7 +466,13 @@ WHERE rngtypid = $1
466466 let mut nullables: Vec < Option < bool > > = nullable_query
467467 . build_query_scalar ( )
468468 . fetch_all ( & mut * self )
469- . await ?;
469+ . await
470+ . map_err ( |e| {
471+ err_protocol ! (
472+ "error from nullables query: {e}; query: {:?}" ,
473+ nullable_query. sql( )
474+ )
475+ } ) ?;
470476
471477 // If the server is CockroachDB or Materialize, skip this step (#1248).
472478 if !self . stream . parameter_statuses . contains_key ( "crdb_version" )
You can’t perform that action at this time.
0 commit comments