add tests for exceptions.