Computers do exactly what you tell them
By their nature, computers follow given instructions exactly. While this is incredibly useful, this also means they will execute harmful or broken instructions with no hesitation. In certain circumstances, this can cost a lot, both in terms of finances, and human lives. It’s important to catch these issues before it’s too late.
Through the duration of this class, I have realized that being able to account for and mitigate mistakes is far more useful and practical than trying for perfection.
“The extensive reviews and tests carried out during the Ariane 5 development program did not include adequate analysis and testing of the inertial reference system or of the complete flight control system, which could have detected the potential failure,″
-Quote from The ESA commission report about The Ariane 5 explosion.
Ariane 5
s
Ariane 5 Exploded shortly after launch due to an unhandled exception. An improperly formatted integer was input into a function which could not handle it, causing loss of stability control. Nothing was done when the exception was thrown, eventually costing the ESA millions of dollars.
In the above image, a divide by zero error is handled in a Lisp program by displaying an error message and replacing the divisor with ‘2’ to prevent the program from crashing or stopping.
- Error messages are visible evidence of proper exception handling.
- Error messages often appear after a program has already mitigated the issue or stopped itself to prevent damage
- Properly coded Error messages can be used to convey a problem without compromising security.
Accounting for human error
Humans aren’t perfect, and it’s unfair to expect it from them or the things they create. Instead focus should be placed on being able to catch these mistakes before they become too big of a problem. Exception handling is a means of providing a safety net to catch issues before they can cause serious damage. A slightly annoying error message is always preferable to a project going up in flames.
Conclusion
- It is important to be aware of what can cause an exception in order to better handle the issue or eliminate it entirely.
- Exception handling should not compromise security
- Exceptions should always be handled to prevent exploits.
- Errors are often annoying but incredibly useful tools