Add new marking errors.
parent
1f258551e1
commit
ee4618f6c8
|
@ -150,3 +150,29 @@ class RevokeError(STIXError, ValueError):
|
|||
return "Cannot revoke an already revoked object."
|
||||
else:
|
||||
return "Cannot create a new version of a revoked object."
|
||||
|
||||
|
||||
class InvalidSelectorError(STIXError, ValueError):
|
||||
"""Granular Marking selector violation. The selector must resolve into an existing STIX object property."""
|
||||
|
||||
def __init__(self, cls, key):
|
||||
super(InvalidSelectorError, self).__init__()
|
||||
self.cls = cls
|
||||
self.key = key
|
||||
|
||||
def __str__(self):
|
||||
msg = "Selector '{0}' in '{1}' is not valid!"
|
||||
return msg.format(self.key, self.__class__.__name__)
|
||||
|
||||
|
||||
class InvalidMarkingError(STIXError, ValueError):
|
||||
"""Marking violation. The marking reference must be a valid identifier."""
|
||||
|
||||
def __init__(self, cls, key):
|
||||
super(InvalidMarkingError, self).__init__()
|
||||
self.cls = cls
|
||||
self.key = key
|
||||
|
||||
def __str__(self):
|
||||
msg = "Marking '{0}' in '{1}' is not a valid marking reference."
|
||||
return msg.format(self.key, self.__class__.__name__)
|
||||
|
|
Loading…
Reference in New Issue