aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/editing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rust/src/editing.rs')
-rw-r--r--rust/src/editing.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/rust/src/editing.rs b/rust/src/editing.rs
index 33caf6a9..e181e8a7 100644
--- a/rust/src/editing.rs
+++ b/rust/src/editing.rs
@@ -29,7 +29,9 @@ impl EditContext {
.count()
.get_result(conn)?;
if count > 0 {
- return Err(FatcatError::EditgroupAlreadyAccepted(self.editgroup_id.to_string()).into());
+ Err(FatcatError::EditgroupAlreadyAccepted(
+ self.editgroup_id.to_string(),
+ ))?;
}
Ok(())
}
@@ -60,10 +62,9 @@ pub fn make_edit_context(
let row = eg.db_create(conn, autoaccept)?;
FatcatId::from_uuid(&row.id)
}
- _ => {
- // TODO: better error response
- bail!("unsupported editgroup context");
- }
+ _ => Err(FatcatError::BadRequest(
+ "unsupported batch editgroup/accept combination".to_string(),
+ ))?,
};
Ok(EditContext {
editor_id,