fixes unhandled error bug

When the unexpected error was thrown, isHandled was not being set to
false. This caused the test to try continuing even though the error had
put it in a state where it could not continue. Here I'm taking
"expectError" to mean "assertError", and considering it to fail the test
when expectations are not met.