mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
make server name check errors much more specific
This can help users by telling them how exactly the check failed, and telling them what the value in the database is, if any.
This commit is contained in:
parent
ea5605bbc3
commit
76ea95634e
2 changed files with 12 additions and 4 deletions
12
src/error.rs
12
src/error.rs
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use std::{fmt, iter, path::PathBuf};
|
||||
|
||||
use ruma::{OwnedServerName, OwnedUserId};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::config::ListenConfig;
|
||||
|
|
@ -84,8 +85,15 @@ pub(crate) enum ServerNameChanged {
|
|||
#[error("failed to check if the admin bot exists")]
|
||||
AdminBotExists(#[source] crate::utils::error::Error),
|
||||
|
||||
#[error("`server_name` in the database and config file differ")]
|
||||
Renamed,
|
||||
#[error(
|
||||
"`server_name` in the database ({0}) and config file ({1}) differ"
|
||||
)]
|
||||
Renamed(OwnedServerName, OwnedServerName),
|
||||
|
||||
#[error(
|
||||
"couldn't find {0} in the database, `server_name` must have changed"
|
||||
)]
|
||||
MissingAdminBot(OwnedUserId),
|
||||
|
||||
#[error("failed to save the configured server_name")]
|
||||
SaveServerName(#[source] crate::utils::error::Error),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue