Informix Error -4130: Handler can't be invoked directly.
Cause and resolution
Handler can't be invoked directly.
A handler cannot be the object of an explicit CALL statement. The only way to invoke a handler is through calling or posting the event to which the handler has been assigned by a HANDLE statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4130 fires when a CALL statement targets a handler directly — per the official guidance, a
handler can only be invoked through calling or posting the event it's been assigned to via a
HANDLE statement.
- A
CALLstatement naming a handler directly, per the official guidance — the direct, only cause.
Solutions / Resolution
- Call or post the event the handler is assigned to, instead of calling the handler itself, per the official guidance.
Examples
Calling a handler directly
CALL myHandler()
-- -4130: myHandler is a HANDLER, not directly callable
Corrected
CALL MyEvent()
-- MyEvent is assigned to myHandler via a HANDLE statement
Diagnostic Checks
- Check whether a
CALLstatement's target is declared as aHANDLER, and if so, call or post its assigned event instead.
Related Errors / Related Topics
- -4133 — "Only events can be posted." A related restriction on what
POST(rather thanCALL) can target, reinforcing the same handler-vs-event distinction.
A handler is called directly — call or post its assigned event instead.