Informix Error -4126
-4126 Handler expected.
The identifier in the WITH clause of the HANDLE statement does not identify a handler. If the identifier of the handler specifies a class, check to see that the handler is declared as belonging to that class; otherwise, check to see that it is declared as belonging to the declared class of the target object.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4126 fires when the identifier in a HANDLE statement's WITH clause doesn't identify a
handler — per the official guidance, check whether the handler is declared as belonging to the
class specified (or, if none is specified, the target object's declared class).
- The
WITHclause identifier isn't a declared handler at all, per the official guidance — the first named cause. - The handler exists but isn't declared as belonging to the expected class, per the official guidance — the second named cause.
Solutions / Resolution
- Check that the handler is declared as belonging to the specified class, per the official guidance, or the target object's declared class if none is specified.
Examples
A WITH clause identifier that isn't a handler
HANDLE MyEvent WITH notAHandler
-- -4126: notAHandler is not declared as a HANDLER
Corrected
HANDLE MyEvent WITH myHandler
Diagnostic Checks
- Check whether the
WITHclause's identifier is declared as aHANDLER, and whether it belongs to the expected class.
Related Errors / Related Topics
- -4127 — "Event expected." The companion error, about the event identifier before
WITHrather than the handler identifier after it. - -4128 — "Handler should be a member of either the same class, or else a base class, of the object." A related handler-scope error, about a handler that exists but belongs to an incompatible class.
The WITH clause's identifier isn't a declared handler — check its declaration and class
membership.