Add exception handler in snipet.

This would complement the description about the error.