fix(api): map CHECK-constraint violation (empty key) to 422
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user