From e51fa24b018f2164bb62da35394e1965678dff80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Tue, 17 Jan 2023 09:31:55 +0100 Subject: [PATCH] client: Return early from purge command if build is not found --- flat-manager-client | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flat-manager-client b/flat-manager-client index 07b706f..c0f4eac 100755 --- a/flat-manager-client +++ b/flat-manager-client @@ -499,6 +499,8 @@ async def purge_build(session, build_url, token): print("Purging build %s" % (build_url)) resp = await session.post(build_url + "/purge", headers={'Authorization': 'Bearer ' + token}, json= {} ) async with resp: + if resp.status == 404: + return "build not found" if resp.status != 200: raise ApiError(resp, await resp.text()) return await resp.json()