Better subreddit error messages. Closes #131

This commit is contained in:
spikecodes 2021-02-22 16:43:32 -08:00
parent 2f3315dcfc
commit 8034594006
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
2 changed files with 32 additions and 17 deletions

View file

@ -74,7 +74,12 @@ pub async fn page(req: Request<()>) -> tide::Result {
prefs: prefs(req),
})
}
Err(msg) => error(req, msg).await,
Err(msg) => match msg.as_str() {
"quarantined" => error(req, format!("r/{} has been quarantined by Reddit", sub)).await,
"private" => error(req, format!("r/{} is a private community", sub)).await,
"banned" => error(req, format!("r/{} has been banned from Reddit", sub)).await,
_ => error(req, msg).await,
},
}
}