Repository navigation
Commit e43f221
committed
fix: prevent KeyError when wiki file does not exist in download fallback
When the MediaWiki FileApi returns download-notfound, the exception raised
inside the try block was silently caught by the broad `except Exception`,
setting web_api_failed=True. The subsequent fallback then crashed with
KeyError: 'url' because the file's imageinfo has no URL for non-existent
files. Fix by using a flag instead of raising inside the try block.1 parent 54493b2 commit e43f221
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
0 commit comments