Fix unhelpful error message when response code is unexpected.

[#85167040]