#850 – Three Types of Errors that Can Lead to Exceptions

An exception is an event that occurs at run-time and is not part of the normal expected execution of your code.

There are different scenarios that can lead to an exception occurring while your application is executing.  They can be broken down into the following three categories:

  • User errors
  • Runtime errors
  • Bugs

user error is anything that the user does that you did not expect him to do.  For example, you might ask the user to enter his age and he enters “Bob” instead.

runtime error is an error that occurs as a result of something going wrong within one of the methods in the .NET Framework.  For example, you might run out of disk space while trying to write a file.

bug is a mistake that you make in your source code, which may lead to an exception.