I once tried Fanuc's Error Code Output which did the job well.
BUT, like 1Cliff suggested, I now grab ERRALL.LS from robot and parse it in PLC.
Advantage is that you get whole error description with all details: alarm code, severity, time, alarm text (including text from user alarms) ...