Ordering.
This commit is contained in:
+10
-10
@@ -107,25 +107,25 @@ impl ClientError for RepositoryError {
|
||||
use crate::repository::{
|
||||
ReferenceRelation as Relation, ReferenceViolationKind as Kind,
|
||||
};
|
||||
match (relation, kind) {
|
||||
(Relation::Account, Kind::Missing) => (
|
||||
match (kind, relation) {
|
||||
(Kind::Missing, Relation::Account) => (
|
||||
StatusCode::UNPROCESSABLE_ENTITY,
|
||||
"Account cannot be found".into(),
|
||||
),
|
||||
(Relation::RecurringTransaction, Kind::StillReferenced) => (
|
||||
(Kind::Missing, Relation::User) => {
|
||||
(StatusCode::NOT_FOUND, "User cannot be found".into())
|
||||
}
|
||||
(Kind::Missing, Relation::UserApp) => {
|
||||
(StatusCode::NOT_FOUND, "User app cannot be found".into())
|
||||
}
|
||||
(Kind::StillReferenced, Relation::RecurringTransaction) => (
|
||||
StatusCode::CONFLICT,
|
||||
"Still referenced by one or more recurring transactions".into(),
|
||||
),
|
||||
(Relation::Transaction, Kind::StillReferenced) => (
|
||||
(Kind::StillReferenced, Relation::Transaction) => (
|
||||
StatusCode::CONFLICT,
|
||||
"Still referenced by one or more transactions".into(),
|
||||
),
|
||||
(Relation::User, Kind::Missing) => {
|
||||
(StatusCode::NOT_FOUND, "User cannot be found".into())
|
||||
}
|
||||
(Relation::UserApp, Kind::Missing) => {
|
||||
(StatusCode::NOT_FOUND, "User app cannot be found".into())
|
||||
}
|
||||
_ => internal_error(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user