diff --git a/src/citrine/_session.py b/src/citrine/_session.py index c403a574b..2ef5d107c 100644 --- a/src/citrine/_session.py +++ b/src/citrine/_session.py @@ -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) diff --git a/src/citrine/_utils/functions.py b/src/citrine/_utils/functions.py index a2c6c3a2a..7cde5aa1f 100644 --- a/src/citrine/_utils/functions.py +++ b/src/citrine/_utils/functions.py @@ -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 @@ -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 diff --git a/src/citrine/exceptions.py b/src/citrine/exceptions.py index a528cce80..bb68e6454 100644 --- a/src/citrine/exceptions.py +++ b/src/citrine/exceptions.py @@ -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": []} ) )