diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-11 17:47:52 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-11 17:47:52 -0800 |
commit | 2ee844b75c611ae32f40f1d65dcb00f3de553240 (patch) | |
tree | 0a763b7fd60ab9c463748fe5294b8b14c7ad4911 /rust/src/editing.rs | |
parent | 21a932b6412cfa9610d3d40c95b34be6e52a97ce (diff) | |
download | fatcat-2ee844b75c611ae32f40f1d65dcb00f3de553240.tar.gz fatcat-2ee844b75c611ae32f40f1d65dcb00f3de553240.zip |
cleanups and TODOs
Diffstat (limited to 'rust/src/editing.rs')
-rw-r--r-- | rust/src/editing.rs | 11 |
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, |