File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,6 @@ fn main() {
6363#[ warn( missing_doc) ] ;
6464
6565#[ feature( macro_rules, struct_variant, globs, phase) ] ;
66- #[ macro_escape] ;
6766
6867extern mod collections;
6968extern mod extra;
@@ -1080,9 +1079,12 @@ impl<'conn> NormalPostgresStatement<'conn> {
10801079 } ,
10811080 Sync ] ) ) ;
10821081 loop {
1083- // TODO forward db errors
10841082 match if_ok_pg ! ( self . conn. read_message( ) ) {
10851083 ReadyForQuery { .. } => break ,
1084+ ErrorResponse { fields } => {
1085+ if_ok ! ( self . conn. wait_for_ready( ) ) ;
1086+ return Err ( PgDbError ( PostgresDbError :: new ( fields) ) ) ;
1087+ }
10861088 _ => { }
10871089 }
10881090 }
@@ -1322,9 +1324,12 @@ impl<'stmt> PostgresResult<'stmt> {
13221324 } ,
13231325 Sync ] ) ) ;
13241326 loop {
1325- // TODO forward PG errors
13261327 match if_ok_pg ! ( self . stmt. conn. read_message( ) ) {
13271328 ReadyForQuery { .. } => break ,
1329+ ErrorResponse { fields } => {
1330+ if_ok ! ( self . stmt. conn. wait_for_ready( ) ) ;
1331+ return Err ( PgDbError ( PostgresDbError :: new ( fields) ) ) ;
1332+ }
13281333 _ => { }
13291334 }
13301335 }
You can’t perform that action at this time.
0 commit comments