replace ErrorKind::Forbidden with forbidden() non-exhaustive constructor

917584e0ca

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-03 15:59:03 -04:00 committed by June
parent 13cd9c4c38
commit ddcf43f1b8
21 changed files with 75 additions and 73 deletions

View file

@ -549,7 +549,7 @@ impl Service {
if !is_accessable_child(current_room, &join_rule.clone().into(), identifier, &allowed_room_ids)? {
debug!("User is not allowed to see room {room_id}");
// This error will be caught later
return Err(Error::BadRequest(ErrorKind::Forbidden, "User is not allowed to see the room"));
return Err(Error::BadRequest(ErrorKind::forbidden(), "User is not allowed to see the room"));
}
let join_rule = join_rule.into();
@ -698,9 +698,9 @@ impl Service {
})
},
Some(SummaryAccessibility::Inaccessible) => {
Err(Error::BadRequest(ErrorKind::Forbidden, "The requested room is inaccessible"))
Err(Error::BadRequest(ErrorKind::forbidden(), "The requested room is inaccessible"))
},
None => Err(Error::BadRequest(ErrorKind::Forbidden, "The requested room was not found")),
None => Err(Error::BadRequest(ErrorKind::forbidden(), "The requested room was not found")),
}
}
}