4 ms·
Huh, I thought it was the opposite: >we use the term exception for expected but irregular situations at runtime and the term error for mistakes in the running
by mLuby 7y ago
Huh, I thought it was the opposite:
>we use the term exception for expected but irregular situations at runtime and the term error for mistakes in the running program that can be resolved only by fixing the program. https://wiki.haskell.org/Error_vs._Exception https://wiki.haskell.org/Error_vs._Exception
- nine_k 7y agoIf you start a thread and it gets killed by OS, it's an exception. You cannot predict when or where it happens, and normally it won't happen; there is no error in your code that leads to this. You can still try to gracefully react on a thread death situation in your code by catching an exception. OTOH if you wrote a non-total function and it fails to proceed given some arguments, this is an error. You should not try to somehow continue if it happens; you should fix your program.
- firethief 7y ago> If you start a thread and it gets killed by OS, it's an exception. You cannot predict when or where it happens, and normally it won't happen; there is no error in your code that leads to this. You can still try to gracefully react on a thread death situation in your code by catching an exception. I don't see how this is different from when a file that's supposed to exist doesn't. I guess it's a matter of degrees.