Your program must be able to detect the error and you can then use the SETLCD y, x, message$ command to display the error on the LCD.
The question of course is what you can detect? E.g. to detect input sensor failure, you will have to know what signify a failure - e.g. an analog sensor that is returning out-of-range data can be detected by the program. You as the programmer has to know how to detect error and then you can display the error.
Other system errors such as runtime error or undefined interrupts will be automatically displayed on the LCD by the PLC firmware.