More precise error messages
This commit is contained in:
parent
4a9f0fba8f
commit
7b9c7f04e7
|
@ -76,9 +76,16 @@ class FavroClient:
|
|||
session: requests.Session | None = None,
|
||||
read_only=True,
|
||||
):
|
||||
assert favro_org_id is not None
|
||||
assert favro_username is not None
|
||||
assert favro_password is not None
|
||||
# Check arguments
|
||||
if not isinstance(favro_org_id, str):
|
||||
msg = f'favro_org_id must be str, but was {type(favro_org_id)}'
|
||||
raise TypeError(msg)
|
||||
if not isinstance(favro_username, str):
|
||||
msg = f'favro_username must be str, but was {type(favro_username)}'
|
||||
raise TypeError(msg)
|
||||
if not isinstance(favro_password, str):
|
||||
msg = f'favro_password must be str, but was {type(favro_password)}'
|
||||
raise TypeError(msg)
|
||||
|
||||
# Setup session
|
||||
self.session = session or requests.Session()
|
||||
|
@ -172,7 +179,7 @@ class FavroClient:
|
|||
response = self.session.get(URL_GET_TAG.format(tag_id=tag_id.raw_id))
|
||||
return TagInfo.from_json(response.json())
|
||||
|
||||
def get_custom_field(self, tag_id: CustomFieldId) -> CustomFieldInfo:
|
||||
def get_custom_field(self, custom_field_id: CustomFieldId) -> CustomFieldInfo:
|
||||
response = self.session.get(
|
||||
URL_GET_CUSTOM_FIELD.format(custom_field_id=custom_field_id.raw_id),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user