Match gofile 'error-notFound' status (API prefixes dead-link status with error-)
This commit is contained in:
+1
-1
@@ -169,7 +169,7 @@ class GoFileClient:
|
|||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
raise GoFileError(f"non-JSON response for {cid}: {resp.text[:200]}") from exc
|
raise GoFileError(f"non-JSON response for {cid}: {resp.text[:200]}") from exc
|
||||||
|
|
||||||
if data.get("status") == "notFound":
|
if data.get("status") == "notFound" or "notFound" in str(data.get("status", "")):
|
||||||
raise GoFileNotFound(f"content {cid} does not exist anymore (dead link)")
|
raise GoFileNotFound(f"content {cid} does not exist anymore (dead link)")
|
||||||
if data.get("status") != "ok":
|
if data.get("status") != "ok":
|
||||||
raise GoFileError(f"content request failed for {cid}: {data.get('status')}")
|
raise GoFileError(f"content request failed for {cid}: {data.get('status')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user