diff --git a/src/api.rs b/src/api.rs index cd8087c..2441c82 100644 --- a/src/api.rs +++ b/src/api.rs @@ -62,10 +62,18 @@ pub async fn create_recording(path: &str, config: &Config) -> Result().await { + Ok(json) => { + bail!("{}", json.message); + } - response.error_for_status_ref()?; + Err(_) => { + bail!("The recording exceeds the server-configured size limit"); + } + } + } else { + response.error_for_status_ref()?; + } Ok(response.json::().await?) }