diff --git a/src/client.rs b/src/client.rs index bc07168..6e73a59 100644 --- a/src/client.rs +++ b/src/client.rs @@ -382,6 +382,14 @@ pub async fn json(path: String, quarantine: bool) -> Result { let () = force_refresh_token().await; return Err("OAuth token has expired. Please refresh the page!".to_string()); } + // Handle quarantined + if json["reason"] == "quarantined" { + return Err("quarantined".into()); + } + // Handle gated + if json["reason"] == "gated" { + return Err("gated".into()); + } Err(format!("Reddit error {} \"{}\": {} | {path}", json["error"], json["reason"], json["message"])) } else { Ok(json)