SimS is right. I had this happen this happen to me as I was testing a switch. You have to ground the switch body because I believe the white wire is the grounding wire to the switch, and it grounds out the High Voltage.
This diagram is similar. It is the white switch.
Recent image by Restrorob on Photobucket
The HV goes to pin M, and if the switch is not grounded, the voltage goes through you.
If you installed the wrong, then you will get the shock.
They make many variations of that switch.
You need the one that the terminal does directly to the metal of the switch.
If the switch is mounted on a non conducting item like plastic, etc, add a wire to the switch under the switch nut and run that wire to ground.