Ensure that errors are raised when a token exchange fails.