Runtime Errors¶ The second type of error is a runtime error, so called because the error does not appear until you run the program. These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened.
Why am I getting a runtime error?
Runtime Errors
Depending on the situation, there are a few reasons why a runtime error might occur: There's a bug in the software. Memory or another system resource is in short supply. You've entered a foreign character into a text field, or performed some kind of action that isn't allowed.
Can runtime errors be caught?
Runtime errors don't need to be explicitly caught and handled in code. However, it may be useful to catch them and continue program execution. To handle a runtime error, the code can be placed within a try-catch block and the error can be caught inside the catch block.