from help:
The on ERROR event triggers when an IRC Server sends an ERROR message, this usually occurs on a disconnection.
so its traps SERVER errors, not script errors, but the event must be coded in any script that wants to use it, it is NOT global if loaded in one script.