Programs can fail gracefully instead of crashing
Sometimes an instruction cannot finish the way you hoped: bad input, a broken rule, a missing file. Instead of letting the whole program crash, you can attempt the risky part and handle the problem if it happens.
You can also deliberately raise a problem yourself when your own rule is broken, such as trying to withdraw more money than an account holds.
- Wrap risky instructions in ATTEMPT.
- Deliberately THROW PROBLEM when a rule is broken.
- Handle it with IF PROBLEM OCCURS instead of crashing.
- Read what went wrong with PROBLEM DETAILS.