Thrown object should be Exception instance

Fix Socket encryption error message
Improve exception message