From eb97489a4199fba6bd195bb25867a20c207db283 Mon Sep 17 00:00:00 2001 From: Firaenix Date: Sun, 13 Sep 2020 23:46:44 +1000 Subject: [PATCH] fix low funds error --- src/api/job_api.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/job_api.rs b/src/api/job_api.rs index 9ce19b7..42dd816 100644 --- a/src/api/job_api.rs +++ b/src/api/job_api.rs @@ -51,7 +51,9 @@ pub async fn post_job(request: &CreateJobAPIRequest, token: &str) -> std::result } }; - + if res.status() == StatusCode::PAYMENT_REQUIRED { + return Err(job_errors::JobErrors::LowFunds) + } let api_response: CreateJobAPIResponse = res.json::().await?;