4 ms·
If an error is caught and handled, calling it a crash seems disingenuous.
by peteretep 11y ago
If an error is caught and handled, calling it a crash seems disingenuous.
- deleted 11y ago[deleted]
- z3t4 11y agoOne mistake that ppl do is they wrap their code around a try ... catch, where it's better to throw an error and exit. If there's an error in one place, chances are there are also errors elsewhere, so it's better to restart the program instead of continue with a bad state. When the error gets thrown in your face, there's a higher chance that it gets fixed. But this also have its setbacks. Loosing the whole state can be really bad.
- peteretep 11y agoI'm really note sure why you think catching an error in a separate process is somehow superior to catching it in a higher scope
- sacado2 11y agoI think it depends on the kind of error. If it is a "bug-detected" error (null-pointer dereference, out-of-bounds, divide-by-zero, out-of-memory, etc.), you better restart the program since you're in an unstable state. If it is a "domain-specific" error (connection lost, robot could not reach its destination, battery low, etc.), you better deal with it as soon as possible.