More error handling improvements

This commit is contained in:
2024-08-06 16:00:38 +03:00
parent eba30d1e9d
commit 75afab933d
12 changed files with 87 additions and 85 deletions

View File

@ -29,7 +29,7 @@ pub async fn set(
let folder_info = db::folder::get_by_id(params.folder_id, &pool)
.await
.handle_internal("Error getting folder info")?
.ok_or_else(GeneralError::item_not_found)?;
.item_not_found()?;
if folder_info.owner_id == params.user_id {
return Err(GeneralError::message(
StatusCode::BAD_REQUEST,