fix test to expect correct error type