Commit 601c582
committed
fix(worker): surface EXPIRED_LINK / INVALID_LINK instead of UNKNOWN_ERROR
Two bugs were combining to mask real failures:
1. download_file treated any non-200 HEAD as INVALID_LINK, including the
4xx response that click.discord.com → GCS gives once the signed URL
has expired. The user's link looked fine when they pasted it; it just
timed out before the worker got to it.
2. process_package had `expected = ('EXPIRED_LINK')` — a string, not a
tuple, because the parens are grouping rather than building a tuple.
The substring check (`if expected not in current`) only recognized
EXPIRED_LINK; INVALID_LINK and any future codes got relabeled as
UNKNOWN_ERROR.
Net effect from the user's POV: they'd retry an expired link and see
'UNKNOWN_ERROR' three times before realizing they needed a fresh export.
Now:
- HEAD 4xx → EXPIRED_LINK (the common case for stale links).
- HEAD non-200 / wrong content-type → INVALID_LINK.
- Anything else → UNKNOWN_ERROR with the full traceback preserved.
- The expected-codes list is a real tuple containing both known codes.1 parent de1c31d commit 601c582
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
973 | 981 | | |
974 | 982 | | |
975 | 983 | | |
976 | | - | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
977 | 992 | | |
978 | 993 | | |
979 | | - | |
| 994 | + | |
980 | 995 | | |
981 | 996 | | |
982 | 997 | | |
| |||
0 commit comments