84 lines
5.2 KiB
Markdown
84 lines
5.2 KiB
Markdown
# Error recovery
|
||
|
||
Code: `core::error` (kinds), `core::recover` (waits, host rests, folders), `core::net_state`, `core::recover::sleep`. Checked by `cargo test -p medlar-core --test recover`.
|
||
|
||
## Kinds
|
||
|
||
Title and text: `error.<kind>` and `error.<kind>.why` in the catalogue; button: `fix.<fix>`. "later a–b s": waits double from a to b, up to the number of tries (10; per task; 0 is forever).
|
||
|
||
| Kind | Title | Severity | Tried again | Fix |
|
||
|---|---|---|---|---|
|
||
| `dns` | Server not found | passing | later 5–300 s | Network settings (`check_network`) |
|
||
| `proxy` | No connection through the proxy | passing | later 5–300 s | Network settings (`check_network`) |
|
||
| `unreachable` | Server out of reach | passing | later 5–300 s | Network settings (`check_network`) |
|
||
| `refused` | Connection refused | passing | later 5–300 s | Try again (`try_again`) |
|
||
| `timeout` | Server does not answer | passing | later 5–300 s | Try again (`try_again`) |
|
||
| `cut` | Connection lost | passing | later 5–300 s | Try again (`try_again`) |
|
||
| `busy` | Server is busy | passing | later 30–600 s | Try again (`try_again`) |
|
||
| `server` | Server error | passing | later 15–600 s | Try again (`try_again`) |
|
||
| `bad_reply` | Wrong answer from the server | passing | later 30–600 s | Try again (`try_again`) |
|
||
| `file_busy` | File in use | passing | later 10–120 s | Try again (`try_again`) |
|
||
| `offline` | No network | passing | when the network is back | Network settings (`check_network`) |
|
||
| `portal` | Network needs a sign-in | blocked | when the network is back | Open sign-in page (`open_portal`) |
|
||
| `sleep` | Computer sleeps | passing | on wake | Resume (`resume`) |
|
||
| `disk_full` | Disk is full | blocked | when the folder is usable | Free up space (`free_space`) |
|
||
| `read_only` | Disk is read-only | blocked | when the folder is usable | Change folder (`change_folder`) |
|
||
| `folder_gone` | Folder is gone | blocked | when the folder is usable | Change folder (`change_folder`) |
|
||
| `drive_gone` | Drive is gone | blocked | when the folder is usable | Change folder (`change_folder`) |
|
||
| `denied` | No permission | blocked | when the folder is usable | Change folder (`change_folder`) |
|
||
| `file_gone` | Unfinished file is gone | blocked | when the folder is usable | Start over (`restart`) |
|
||
| `login` | Login needed | blocked | no | Sign in (`sign_in`) |
|
||
| `forbidden` | Access denied | blocked | no | Get new link (`new_link`) |
|
||
| `expired` | Link expired | blocked | no | Get new link (`new_link`) |
|
||
| `link` | Waiting for a new link | blocked | no | Get new link (`new_link`) |
|
||
| `wrong_content` | Not the file | blocked | no | Get new link (`new_link`) |
|
||
| `not_found` | File not found | blocked | no | Edit link (`edit_link`) |
|
||
| `rejected` | Request rejected | blocked | no | Edit link (`edit_link`) |
|
||
| `bad_link` | Link can't be used | blocked | no | Edit link (`edit_link`) |
|
||
| `changed` | File changed on the server | blocked | no | Choose (`choose`) |
|
||
| `checksum` | File is damaged | blocked | no | Choose (`choose`) |
|
||
| `no_resume` | Can't be continued | blocked | no | Choose (`choose`) |
|
||
| `killed` | Interrupted | passing | no | Resume (`resume`) |
|
||
| `drm` | Copy protected | blocked | no | Edit link (`edit_link`) |
|
||
| `tool` | A program is missing | blocked | no | Try again (`try_again`) |
|
||
| `media` | Stream can't be saved | serious | no | Try again (`try_again`) |
|
||
| `tls` | Secure connection failed | serious | no | Try again (`try_again`) |
|
||
| `disk` | Disk error | serious | later 30–600 s | Change folder (`change_folder`) |
|
||
| `list` | Download list not saved | serious | later 30–600 s | Try again (`try_again`) |
|
||
| `crashed` | Medlar made a mistake | serious | no | Try again (`try_again`) |
|
||
|
||
## Matrix
|
||
|
||
Each fault begins at the first byte, or at 5, 50 and 90 % of the file, and stays. "whole": the file is identical. Otherwise the error after the retries; the bytes are kept, and once the fault is gone Resume makes the file whole.
|
||
|
||
| Fault | From the first byte | Later |
|
||
|---|---|---|
|
||
| throttle_conn | whole | whole |
|
||
| throttle_total | whole | whole |
|
||
| latency_ms | whole | whole |
|
||
| stall_after, some bytes each time | whole | whole |
|
||
| stall_after, nothing comes | `timeout` | `timeout` |
|
||
| cut_after, some bytes each time | whole | whole |
|
||
| cut_after, nothing comes | `cut` | `cut` |
|
||
| reset_after, some bytes each time | whole | whole |
|
||
| reset_after, nothing comes | `cut` | `cut` |
|
||
| status 401 | `login` | `login` |
|
||
| status 403 | `forbidden` | `expired` |
|
||
| status 404 | `not_found` | `not_found` |
|
||
| status 410 | `not_found` | `expired` |
|
||
| status 416 | `rejected` | `rejected` |
|
||
| status 418 | `rejected` | `rejected` |
|
||
| status 429 | `busy` | `busy` |
|
||
| status 500 | `server` | `server` |
|
||
| status 503 with retry_after | `busy` | `busy` |
|
||
| wrong_length, too long | `bad_reply` | `bad_reply` |
|
||
| wrong_length, too short | `bad_reply` | `bad_reply` |
|
||
| ignore_range | whole | `no_resume` |
|
||
| change_after | whole (simply another file) | `changed` |
|
||
| version_after_requests | whole (simply another file) | `changed` |
|
||
| gzip | `bad_reply` | `bad_reply` |
|
||
| expire_requests | `forbidden` | `expired` |
|
||
| expire_secs, 410 | `not_found` | `expired` |
|
||
| max_conns | whole | whole |
|
||
|
||
Not seen without a checksum: a server that changes the bytes in the middle but keeps its size, ETag and date.
|