mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 14:43:02 +02:00
Macroize various remaining Error constructions.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
21bbee8e3c
commit
667afedd24
9 changed files with 78 additions and 125 deletions
|
@ -218,7 +218,7 @@ pub(crate) async fn get_pushrule_route(
|
|||
if let Some(rule) = rule {
|
||||
Ok(get_pushrule::v3::Response { rule })
|
||||
} else {
|
||||
Err(Error::BadRequest(ErrorKind::NotFound, "Push rule not found."))
|
||||
Err!(Request(NotFound("Push rule not found.")))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,7 +333,7 @@ pub(crate) async fn set_pushrule_actions_route(
|
|||
.set_actions(body.kind.clone(), &body.rule_id, body.actions.clone())
|
||||
.is_err()
|
||||
{
|
||||
return Err(Error::BadRequest(ErrorKind::NotFound, "Push rule not found."));
|
||||
return Err!(Request(NotFound("Push rule not found.")));
|
||||
}
|
||||
|
||||
let ty = GlobalAccountDataEventType::PushRules;
|
||||
|
@ -400,7 +400,7 @@ pub(crate) async fn set_pushrule_enabled_route(
|
|||
.set_enabled(body.kind.clone(), &body.rule_id, body.enabled)
|
||||
.is_err()
|
||||
{
|
||||
return Err(Error::BadRequest(ErrorKind::NotFound, "Push rule not found."));
|
||||
return Err!(Request(NotFound("Push rule not found.")));
|
||||
}
|
||||
|
||||
let ty = GlobalAccountDataEventType::PushRules;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue