Skip to content

Commit 681e60d

Browse files
author
Kirill Kinduk
committed
Added postgres error code handling
1 parent 2f68380 commit 681e60d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pg/error_helper.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ impl From<ErrorHelper> for diesel::result::Error {
2020
SqlState::FOREIGN_KEY_VIOLATION => ForeignKeyViolation,
2121
SqlState::T_R_SERIALIZATION_FAILURE => SerializationFailure,
2222
SqlState::READ_ONLY_SQL_TRANSACTION => ReadOnlyTransaction,
23+
SqlState::NOT_NULL_VIOLATION => NotNullViolation,
24+
SqlState::CHECK_VIOLATION => CheckViolation,
2325
_ => Unknown,
2426
};
2527

0 commit comments

Comments
 (0)