From 2ee844b75c611ae32f40f1d65dcb00f3de553240 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 11 Jan 2019 17:47:52 -0800 Subject: cleanups and TODOs --- rust/src/editing.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'rust/src/editing.rs') 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, -- cgit v1.2.3