diff --git a/src/utils/error.rs b/src/utils/error.rs index db0735c4..980373b9 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -19,52 +19,46 @@ pub(crate) type Result = std::result::Result; #[allow(clippy::error_impl_error)] pub(crate) enum Error { #[cfg(feature = "sqlite")] - #[error( - "There was a problem with the connection to the sqlite database: \ - {source}" - )] + #[error("error connecting to sqlite database")] Sqlite { #[from] source: rusqlite::Error, }, #[cfg(feature = "rocksdb")] - #[error( - "There was a problem with the connection to the rocksdb database: \ - {source}" - )] + #[error("error connecting to rocksdb database")] RocksDb { #[from] source: rocksdb::Error, }, - #[error("Could not generate image thumbnail.")] + #[error("error generating image thumbnail")] GenerateThumbnail(#[source] image::error::ImageError), - #[error("Could not connect to server: {source}")] + #[error("error making request to server")] Reqwest { #[from] source: reqwest::Error, }, - #[error("Could build regular expression: {source}")] + #[error("error building regular expression")] Regex { #[from] source: regex::Error, }, - #[error("{0}")] - Federation(OwnedServerName, RumaError), - #[error("Could not do this io: {source}")] + #[error("federation request to {0} returned an error")] + Federation(OwnedServerName, #[source] RumaError), + #[error("IO error")] Io { #[from] source: std::io::Error, }, - #[error("{0}")] + #[error("invalid server response: {0}")] BadServerResponse(&'static str), - #[error("{0}")] + #[error("config error: {0}")] BadConfig(&'static str), - #[error("{0}")] + #[error("invalid data in database: {0}")] /// Don't create this directly. Use [`Error::bad_database`] instead. BadDatabase(&'static str), - #[error("uiaa")] + #[error("UIAA error")] Uiaa(UiaaInfo), - #[error("{0}: {1}")] + #[error("invalid request ({0}): {1}")] BadRequest(ErrorKind, &'static str), #[error("alias already exists")] AliasConflict, @@ -74,11 +68,11 @@ pub(crate) enum Error { Path(#[from] axum::extract::rejection::PathRejection), #[error("{0}")] AdminCommand(&'static str), - #[error("from {0}: {1}")] + #[error("error redacting event from {0}: {1}")] Redaction(OwnedServerName, ruma::canonical_json::RedactionError), #[error("unsupported room version {0}")] UnsupportedRoomVersion(ruma::RoomVersionId), - #[error("{0} in {1}")] + #[error("inconsistent room state in {1}: {0}")] InconsistentRoomState(&'static str, ruma::OwnedRoomId), }