Skip to content

Commit c928250

Browse files
committed
reduce conflict
1 parent cd43f6b commit c928250

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

sqlx-core/src/postgres/copy.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,18 @@ impl<C: DerefMut<Target = PgConnection>> PgCopyIn<C> {
262262
"fail_with: expected ErrorResponse, got: {:?}",
263263
msg.format
264264
)),
265-
Err(Error::Database(e)) => match e.code() {
266-
Some(Cow::Borrowed("57014")) => {
267-
conn.stream
268-
.recv_expect(MessageFormat::ReadyForQuery)
269-
.await?;
270-
Ok(())
265+
Err(Error::Database(e)) => {
266+
match e.code() {
267+
Some(Cow::Borrowed("57014")) => {
268+
// postgres abort received error code
269+
conn.stream
270+
.recv_expect(MessageFormat::ReadyForQuery)
271+
.await?;
272+
Ok(())
273+
}
274+
_ => Err(Error::Database(e)),
271275
}
272-
_ => Err(Error::Database(e)),
273-
},
276+
}
274277
Err(e) => Err(e),
275278
}
276279
}

0 commit comments

Comments
 (0)