Add custom response status for not subscribed

This commit is contained in:
asonix 2020-03-18 12:47:02 -05:00
parent 19a6a6e61c
commit cdef00f844

View file

@ -85,6 +85,7 @@ impl ResponseError for MyError {
| MyError::Whitelist(_) | MyError::Whitelist(_)
| MyError::WrongActor(_) | MyError::WrongActor(_)
| MyError::BadActor(_, _) => StatusCode::FORBIDDEN, | MyError::BadActor(_, _) => StatusCode::FORBIDDEN,
MyError::NotSubscribed(_) => StatusCode::UNAUTHORIZED,
MyError::Duplicate => StatusCode::ACCEPTED, MyError::Duplicate => StatusCode::ACCEPTED,
MyError::Kind(_) => StatusCode::BAD_REQUEST, MyError::Kind(_) => StatusCode::BAD_REQUEST,
_ => StatusCode::INTERNAL_SERVER_ERROR, _ => StatusCode::INTERNAL_SERVER_ERROR,