mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
rename Error::Conflict to Error::AliasConflict
This is only used in one place.
This commit is contained in:
parent
a2628357fd
commit
ed7f7b2461
2 changed files with 4 additions and 5 deletions
|
|
@ -44,7 +44,7 @@ pub(crate) async fn create_alias_route(
|
|||
}
|
||||
|
||||
if services().rooms.alias.resolve_local_alias(&body.room_alias)?.is_some() {
|
||||
return Err(Error::Conflict("Alias already exists."));
|
||||
return Err(Error::AliasConflict);
|
||||
}
|
||||
|
||||
services().rooms.alias.set_alias(
|
||||
|
|
|
|||
|
|
@ -69,9 +69,8 @@ pub(crate) enum Error {
|
|||
Uiaa(UiaaInfo),
|
||||
#[error("{0}: {1}")]
|
||||
BadRequest(ErrorKind, &'static str),
|
||||
// This is only needed for when a room alias already exists
|
||||
#[error("{0}")]
|
||||
Conflict(&'static str),
|
||||
#[error("alias already exists")]
|
||||
AliasConflict,
|
||||
#[error("{0}")]
|
||||
Extension(#[from] axum::extract::rejection::ExtensionRejection),
|
||||
#[error("{0}")]
|
||||
|
|
@ -152,7 +151,7 @@ impl Error {
|
|||
ErrorKind::UnsupportedRoomVersion,
|
||||
StatusCode::INTERNAL_SERVER_ERROR,
|
||||
),
|
||||
Self::Conflict(_) => (Unknown, StatusCode::CONFLICT),
|
||||
Self::AliasConflict => (Unknown, StatusCode::CONFLICT),
|
||||
_ => (Unknown, StatusCode::INTERNAL_SERVER_ERROR),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue