Add exception message and use correct exception type

Change-Id: Ie358f018a974200be9a7bd179c42a944cf613c43
Merge "Add exception message and use correct exception type"