improve invalid response object error message