fix: sqlite returns runtime error, catch it

prob too wide but i wanna use sqlite
This commit is contained in:
əlemi 2024-03-22 06:53:40 +01:00
parent 4fd8ad2c2c
commit 0ec636a868
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -184,6 +184,7 @@ pub async fn inbox(
};
match model::like::Entity::insert(like).exec(ctx.db()).await {
Err(sea_orm::DbErr::RecordNotInserted) => Err(StatusCode::NOT_MODIFIED),
Err(sea_orm::DbErr::Exec(_)) => Err(StatusCode::NOT_MODIFIED), // bad fix for sqlite
Err(e) => {
tracing::error!("unexpected error procesing like from {aid} to {oid}: {e}");
Err(StatusCode::INTERNAL_SERVER_ERROR)