An E2 error code indicates that there is something occurring electrically, within the water heater.
A common solution for this is to first unplug the water heater from its electrical supply. Next, remove the cover by unscrewing the four screws that hold it in place. The indoor mounted 40HI models have a ribbon cable connecting the display to the computer board. Please be careful as to not damage this wire. You will need to disconnect it using the black connector located 6 inches from the display itself.
Once inside the water heater, you will see a grey box which contains the computer board located on the right side. If you remove the two screws on the face of the computer board, it will slide out freely from the box. Next, disconnect and reconnect all of the wires which are connected to the computer board to verify that everything is seated properly. You can then screw the computer board back in place, replace the cover, plug up the power supply, and attempt to run the water heater as normal.