Using the OnError property
Another useful approach in handling errors is using the OnError
property for the app itself. This property can be found as shown in Figure 14.12.
Figure 14.12 – Accessing the OnError app property
The OnError
property is used to define how the app should respond to unexpected errors that come about during the execution of the app. This property is designed to handle errors that are not addressed by other error-handling methods, such as the built-in error functions that we reviewed previously (IfError()
, IsError()
, etc.). These types of errors are referred to as unhandled errors as they have not been handled by the error handling functions.
Examples of use cases for OnError
When an unhandled error occurs in a Power App, the OnError
property is triggered. This allows developers to define a specific action or response when such errors arise. The typical use cases include the following:
- Logging errors: Developers...