Exceptions are handled properly.

Signed-off-by: Sanjay Madnani <http://sanjaymadnani.wordpress.com/>