Try OpenEdge Now
skip to main content
Programming Interfaces
Data Management : ABL API for Multi-tenant and Table Partition Management : Handling errors : Handling data errors with the DataAdminErrorHandler class
 
Handling data errors with the DataAdminErrorHandler class
You can use the OpenEdge.DataAdmin.Error.DataAdminErrorHandler class to display data errors in code that uses the API. The default behavior is to display all data errors and the stack trace in a message box.
Data errors occur, for example, when a data commit fails validation or from some other data access problem. By default, these errors are not thrown from the service object that generates them because any attempted data updates might still be possible and the issue that caused the failure corrected. However, this error correction is difficult if the error is thrown.
In the following code, added in any block where the API is called, the Error( ) method on DataAdminErrorHandler displays the error messages thrown from the DataAminService class and its related classes:
using Progress.Lang.*.
using OpenEdge.DataAdmin.Error.*.

catch e as Error :
errorHandler = new DataAdminErrorHandler().
errorHandler:Error(e).
end catch.