fix(api): map CHECK-constraint violation (empty key) to 422

This commit is contained in:
2026-06-04 14:35:56 +02:00
parent fd1c22191b
commit daad9438ba
2 changed files with 23 additions and 0 deletions
+2
View File
@@ -500,6 +500,8 @@ pub(crate) async fn create_field_definition(
Some("23505") => Err(StatusCode::CONFLICT),
// Referenced vocabulary doesn't exist — client error, not server fault.
Some("23503") => Err(StatusCode::UNPROCESSABLE_ENTITY),
// CHECK constraint violated (e.g. empty key) — client error.
Some("23514") => Err(StatusCode::UNPROCESSABLE_ENTITY),
_ => Err(StatusCode::INTERNAL_SERVER_ERROR),
}
}