Add error handling

This commit is contained in:
Sik Yoon 2023-08-02 21:18:09 +09:00
parent 046195503c
commit fdc7c887e5

View File

@ -167,6 +167,10 @@ pub async fn market_cap_index() -> Result<(), Box<dyn std::error::Error + Send +
return Err("Err")?; return Err("Err")?;
} }
if v.as_object().unwrap().get("data").is_none() {
return Err("Err")?;
}
into_vec = v into_vec = v
.as_object() .as_object()
.unwrap() .unwrap()