CHAPTER 1 - Introduction to X++
CHAPTER 2 - X++ Control Statements
CHAPTER 3 - Objects and Classes
CHAPTER 4: Accessing the Database
CHAPTER 5: Exception Handling
CHAPTER 6: Security for Developers
Lesson 1 – Exceptions
An exception is a situation where the flow of a program’s execution is interrupted. Examples of axexceptions include the following:
- Printing to a printer that is not powered on
- Accessing a file that does not exist
- Updating a record that does not exist
When these occur, the program must handle them. For example, if the user requests a file that does not exist, the program might have to catch the exception and create a new file.
There are many types of exception thrown, depending on what caused the axexception. A majority types are determined by the kernel and are not usually thrown by application code. However, all types can be caught, and it is the developer’s responsibility to decide which must be handled. The axexception type is identified using the system enum.