Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/citrine/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def checked_request(self, method: str, path: str,
raise Conflict(path, response)
elif response.status_code == 425:
logger.debug('%s %s %s', response.status_code, method, path)
msg = 'Cant execute at this time. Try again later. Error: {}'.format(response.text)
msg = 'Cannot execute at this time. Try again later. Error: {}'.format(response.text)
raise WorkflowNotReadyException(msg)
else:
logger.error('%s %s %s', response.status_code, method, path)
Expand Down
8 changes: 5 additions & 3 deletions src/citrine/_utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ def validate_type(data_dict: dict, type_name: str) -> dict:
data_dict_copy = data_dict.copy()
if 'type' in data_dict_copy:
if data_dict_copy['type'] != type_name:
raise Exception(
"Object type must be {}, but was instead {}.".format(type_name, data_dict['type']))
raise TypeError(
"Object type must be '{}', but was '{}'. "
"Verify you are passing the correct object type."
.format(type_name, data_dict['type']))
else:
data_dict_copy['type'] = type_name

Expand Down Expand Up @@ -258,7 +260,7 @@ def migrate_deprecated_argument(
if new_arg is None:
return old_arg
else:
raise ValueError(f"Cannot specify both \'{new_arg_name}\' and \'{new_arg_name}\'")
raise ValueError(f"Cannot specify both \'{new_arg_name}\' and \'{old_arg_name}\'")
elif new_arg is None:
raise ValueError(f"Please specify \'{new_arg_name}\'")
return new_arg
Expand Down
2 changes: 1 addition & 1 deletion src/citrine/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def build(*, message: str, method: str, path: str, params: dict = {}):
status_code=404,
request=SimpleNamespace(method=method.upper()),
reason="Not Found",
json=lambda self: {"code": 404, "message": message, "validation_errors": []}
json=lambda: {"code": 404, "message": message, "validation_errors": []}
)
)

Expand Down
Loading