Skip to content

Commit

Permalink
Use f-string and dynamic value
Browse files Browse the repository at this point in the history
for error logging not using a static value
  • Loading branch information
DevRyu authored and wonder6845 committed Aug 23, 2022
1 parent 02f4572 commit d642ead
Show file tree
Hide file tree
Showing 4 changed files with 369 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

import sys
from typing import TYPE_CHECKING

from msrest import Deserializer, Serializer
Expand All @@ -24,6 +24,9 @@
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional

def func_name():
return sys._getframe(1).f_code.co_name

class _SDKClient(object):
def __init__(self, *args, **kwargs):
"""This is a fake class to support current implemetation of MultiApiClientMixin."
Expand Down Expand Up @@ -124,7 +127,7 @@ def __init__(
if api_version == '2016-10-01' or api_version == '7.0' or api_version == '7.1' or api_version == '7.2' or api_version == '7.3':
base_url = '{vaultBaseUrl}'
else:
raise ValueError("API version {} is not available".format(api_version))
raise ValueError(f"API version {api_version} does not have operation '{func_name()}'")
self._config = KeyVaultClientConfiguration(**kwargs)
self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs)
super(KeyVaultClient, self).__init__(
Expand Down
Loading

0 comments on commit d642ead

Please sign in to comment.