Fix type error message in format_url

The error message for a TypeError in format_url mentioned a key error rather
than a type error as it should have.

Change-Id: I8557d49901f8a8e591654ef0bd530eb8e45e8b5b
Merge "Fix type error message in format_url"