[test] Add exception handling testing

Change-Id: I16dc233f98585e211b573eb0dcc02491f2fbe826