Add message sending.
This commit is contained in:
@@ -31,6 +31,10 @@ pub enum Error {
|
||||
#[snafu(display("You have been blocked by this user."))]
|
||||
BlockedByOther,
|
||||
|
||||
// ? Channel related errors.
|
||||
#[snafu(display("Already sent a message with this nonce."))]
|
||||
AlreadySentMessage,
|
||||
|
||||
// ? General errors.
|
||||
#[snafu(display("Failed to validate fields."))]
|
||||
FailedValidation { error: ValidationErrors },
|
||||
@@ -62,6 +66,8 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
Error::Blocked => Status::Conflict,
|
||||
Error::BlockedByOther => Status::Forbidden,
|
||||
|
||||
Error::AlreadySentMessage => Status::Conflict,
|
||||
|
||||
Error::FailedValidation { .. } => Status::UnprocessableEntity,
|
||||
Error::DatabaseError { .. } => Status::InternalServerError,
|
||||
Error::InternalError => Status::InternalServerError,
|
||||
|
||||
Reference in New Issue
Block a user