Skip to content

Commit ce56e31

Browse files
authored
Update error message raised when getting a service from an invalid API version. (#751)
1 parent 15d3efa commit ce56e31

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

google/ads/googleads/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,11 @@ def _get_api_services_by_version(cls, version):
203203
version_module = import_module(f"google.ads.googleads.{version}")
204204
except ImportError:
205205
raise ValueError(
206-
'Specified Google Ads API version "{}" does not '
207-
'exist. Valid API versions are: "{}"'.format(
208-
version, '", "'.join(_VALID_API_VERSIONS)
209-
)
206+
f"There was an error importing the "
207+
f'"google.ads.googleads.{version}" module. Please check that '
208+
f'"{version}" is a valid API version. Here are the current '
209+
"API versions supported by this library: "
210+
f"{', '.join(_VALID_API_VERSIONS)}."
210211
)
211212
return version_module
212213

0 commit comments

Comments
 (0)