Skip to content

Commit

Permalink
Merge pull request #117 from prebid/dshore/google_ads_error_message
Browse files Browse the repository at this point in the history
Error for unsupported GAM API version is not handled properly (#116)
  • Loading branch information
dshore authored Aug 25, 2022
2 parents 7051078 + 470a13f commit d671138
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion line_item_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
__version__ = '0.2.9'

# For an official release, use dev_version = ''
dev_version = ''
dev_version = '1'

version = __version__
if dev_version:
Expand Down
6 changes: 4 additions & 2 deletions line_item_manager/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def create(ctx: click.core.Context, configfile: str, **kwargs):
raise click.UsageError(f"Network name found \'{gam.network['displayName']}\' " \
f"does not match provided \'{config.network_name}\'", ctx=ctx)
except GoogleAdsError as _e:
raise click.UsageError('Check your network code and permissions. Not able to ' \
'successfully access your service account', ctx=ctx)
logger.error(f'GoogleAdsError, {_e}')
raise click.UsageError(
'Not able to successfully access your service account. ' \
'Check WARNING/ERROR messages above and consider \nupgrading to latest version.', ctx=ctx)

# validate user configuration
user_cfg = Validator(config.schema, config.user)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_txt(filename):

requirements = [
'Click==7.1.2',
'googleads==25.0.0',
'googleads==33.0.0',
'jinja2==3.0.3',
'jsonschema==4.4.0',
'PyYAML>=5.4',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def raise_exception(self):
runner = CliRunner()
result = runner.invoke(cli.create, shlex.split(command))
assert result.exit_code == 2
assert "Check your network code and permissions" in result.output
assert "Not able to successfully access your service account" in result.output

@pytest.mark.parametrize("command", [
(f'tests/resources/cfg_video.yml -k {KEY_FILE} -b {CONFIG_BIDDER}'),
Expand Down

0 comments on commit d671138

Please sign in to comment.