We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 042e411 commit 0342bcdCopy full SHA for 0342bcd
.github/workflows/publish-validation.yml
@@ -24,13 +24,20 @@ jobs:
24
run: |
25
python3 - <<'PY'
26
import json
27
+ import urllib.error
28
import urllib.request
29
30
name = "fynch"
31
url = f"https://crates.io/api/v1/crates/{name}"
32
try:
33
with urllib.request.urlopen(url, timeout=10) as resp:
34
data = json.load(resp)
35
+ except urllib.error.HTTPError as e:
36
+ if e.code == 404:
37
+ print(f"crates.io: {name} not found (ok for first publish)")
38
+ raise SystemExit(0)
39
+ print(f"crates.io query failed for {name}: HTTP {e.code}: {e}")
40
+ raise SystemExit(1)
41
except Exception as e:
42
print(f"crates.io query failed for {name}: {e}")
43
raise SystemExit(1)
0 commit comments