| ▲ | josephg 4 hours ago | ||||||||||||||||
There is no recovery. When an invariant is violated, the system is in a corrupted state. Usually the only sensible thing to do is crash. If there's a known bug in a program, you can try and write recovery code to work around it. But its almost always better to just fix the bug. Small, simple, correct programs are better than large, complex, buggy programs. | |||||||||||||||||
| ▲ | addaon 3 hours ago | parent [-] | ||||||||||||||||
> Usually the only sensible thing to do is crash. Correct. But how are you testing that you successfully crash in this case, instead of corrupting on-disk data stores or propagating bad data? That needs a test. | |||||||||||||||||
| |||||||||||||||||