2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-15 07:43:26 +00:00

Remove unused error code

This change removes unused exceptions defined in core/errors.py,
along with the errors.py module itself. The few used items from
this file are migrated over to core/exceptions.py. Any dependent
code is updated, dropping the use of errors.py and adding in the
use of exceptions.py.
This commit is contained in:
Peter Hamilton
2017-12-07 20:11:18 -05:00
parent d984c77211
commit 54b1df7726
14 changed files with 247 additions and 220 deletions

View File

@@ -27,8 +27,8 @@ from kmip.core.enums import Tags
from kmip.core.enums import Types
from kmip.core.enums import CredentialType
from kmip.core.enums import RevocationReasonCode as RevocationReasonCodeEnum
from kmip.core import exceptions
from kmip.core.errors import ErrorStrings
from kmip.core.misc import KeyFormatType
from kmip.core import primitives
@@ -474,8 +474,12 @@ class KeyBlock(Struct):
member = 'KeyBlock.key_format_type'
exp_type = KeyFormatType
rcv_type = type(self.key_format_type)
msg = ErrorStrings.BAD_EXP_RECV.format(member, 'type',
exp_type, rcv_type)
msg = exceptions.ErrorStrings.BAD_EXP_RECV.format(
member,
'type',
exp_type,
rcv_type
)
raise TypeError(msg)