That is a general error. Only gets set a couple of places. 1) at the end of logic, in response to one of the error flags getting set, and 2) at the end of logic, in response to $Main not running.
Possible error flags:
Watchdog timout
I/O config error
I/O map error
Math stack overflow
STOP instruction
Critical I/O failure (failed module)
Ethernet I/O failure
For any of these, the associated error bit would be set. They start at ST128, and are also mapped into DST5.
The $Main check was added in 2.9. It just makes sure that $Main is running (which it should always be) and drops to program if not. If it is this, ERR string gets to "$Main failure".