ajGetModelError function
Description
The ajGetModelError retrieves error records from the Model Error List. This function is normally used together with ajRaiseError function.
Syntax
ajGetModelError([cell_reference], [error_code], [error_message])
Argument Name | Description |
---|---|
cell_reference (optional) | Specify the cell address to be filtered and shown from the list of cell addresses added by the ajRaiseError function. If you do not specify anything, the default value will always be an empty string (“”) which means no filter condition. |
error_code (optional) | Specify the error code to be filtered and shown from the list of error codes added by the ajRaiseError function. If you do not specify anything, the default value will always be an empty string (“”) which means no filter condition. |
error_message (optional) | Specify the partial or full string condition to be used to filter and show the list of error messages added by the ajRaiseError function. It is case-insensitive. For example, records with an error message “ABCDE” will be shown with Error_message “b”. If you do not specify anything, the default value will always be an empty string (“”) which means no filter condition. |
The function will return:
1) Content type: Records from Model Error List
2) Method: Cell array
Examples
Here are a few examples of ajGetModelError function.
Example 1
First, we use ajRaiseError to add two errors into the Model Error List.
We can then return all errors from the Model Error List by using ajGetModelError with no parameters. This indicates no filter conditions should be applied.
Example 2
Using the same Model Error List as shown in Example 1, we define a filter condition this time.
The result shows that the filter condition is a partial match and it is case-insensitive.