Skip to content

Commit 67c677e

Browse files
authored
Merge pull request #74 from evilbluebeaver/main
Added postgres error code handling
2 parents 2f68380 + 681e60d commit 67c677e

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)