How to read error code through Ethernet IP?

Is it possible to read the error code through Ethernet IP at PLC side?