rethrow the error if getchar doesn't work