Throw error on malformed HTTP response