Handle exceptions gracefully

Change-Id: Ia4534e6d62411e8e4b86279e128c8f461b067719
Merge "Handle exceptions gracefully"