20.1.6.1 Studying Default Error Message Behavior

Review default error messages to see why an Error Handling Function can improve what users see.

To understand why an Error Handling Function may be useful, consider the following examples. Suppose you add the constraint below to the EMP table to enforce the rule that an employee's commission can never be more than twice their salary:
alter table emp
add constraint comm_less_than_twice_sal
check (comm < 2 * sal);
By default, when a user submits changes that violate the constraint, they see the error message:
ORA-02290: check constraint (SCHEMA.COMM_LESS_THAN_TWICE_SAL) violated

Figure 20-18 By Default, Users See Constraint Violation Error Name



Similarly, when the APEX engine raises internal errors, by default the user sees the error message and an invitation to contact their application administrator:
No Primary Key item has been defined for form region Employee

Figure 20-19 By Default, Users See Internal Errors