2024-01-17 13:13:14 +01:00
|
|
|
from __future__ import annotations
|
2016-09-26 00:26:09 +02:00
|
|
|
|
2017-08-28 19:01:53 +02:00
|
|
|
|
2016-09-26 00:26:09 +02:00
|
|
|
class PyMISPError(Exception):
|
2024-01-30 12:51:23 +01:00
|
|
|
def __init__(self, message: str) -> None:
|
2024-01-17 13:13:14 +01:00
|
|
|
super().__init__(message)
|
2016-09-26 00:26:09 +02:00
|
|
|
self.message = message
|
|
|
|
|
|
|
|
|
|
|
|
class NewEventError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-21 00:32:27 +02:00
|
|
|
class UpdateEventError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-09-26 00:26:09 +02:00
|
|
|
class NewAttributeError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-01-12 16:13:32 +01:00
|
|
|
class NewEventReportError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2024-04-23 09:24:44 +02:00
|
|
|
class NewAnalystDataError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NewNoteError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NewOpinionError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
2024-05-22 12:39:29 +02:00
|
|
|
|
2024-04-23 09:24:44 +02:00
|
|
|
class NewRelationshipError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-21 00:32:27 +02:00
|
|
|
class UpdateAttributeError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2021-01-16 16:56:30 +01:00
|
|
|
class NewGalaxyClusterError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NewGalaxyClusterRelationError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-09-26 00:26:09 +02:00
|
|
|
class SearchError(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class MissingDependency(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoURL(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class NoKey(PyMISPError):
|
|
|
|
pass
|
2017-08-28 19:01:53 +02:00
|
|
|
|
|
|
|
|
2024-06-24 14:37:05 +02:00
|
|
|
class MISPAttributeException(PyMISPError):
|
|
|
|
"""A base class for attribute specific exceptions"""
|
|
|
|
|
2017-08-28 19:01:53 +02:00
|
|
|
class MISPObjectException(PyMISPError):
|
2024-06-24 14:37:05 +02:00
|
|
|
"""A base class for object specific exceptions"""
|
|
|
|
|
|
|
|
|
|
|
|
class InvalidMISPAttribute(MISPAttributeException):
|
|
|
|
"""Exception raised when an attribute doesn't respect the constraints in the definition"""
|
2017-08-28 19:01:53 +02:00
|
|
|
|
2024-06-24 14:37:05 +02:00
|
|
|
class InvalidMISPObjectAttribute(MISPAttributeException):
|
|
|
|
"""Exception raised when an object attribute doesn't respect the constraints in the definition"""
|
2017-08-28 19:01:53 +02:00
|
|
|
|
|
|
|
class InvalidMISPObject(MISPObjectException):
|
2024-06-24 14:37:05 +02:00
|
|
|
"""Exception raised when an object doesn't respect the constraints in the definition"""
|
2017-08-28 19:01:53 +02:00
|
|
|
|
2017-11-09 02:33:55 +01:00
|
|
|
|
2017-08-28 19:01:53 +02:00
|
|
|
class UnknownMISPObjectTemplate(MISPObjectException):
|
|
|
|
"""Exception raised when the template is unknown"""
|
2024-06-24 14:37:05 +02:00
|
|
|
|
2018-01-08 11:59:32 +01:00
|
|
|
|
|
|
|
|
2022-12-01 10:05:38 +01:00
|
|
|
class InvalidMISPGalaxy(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-01-08 11:59:32 +01:00
|
|
|
class PyMISPInvalidFormat(PyMISPError):
|
|
|
|
pass
|
2018-08-09 18:11:45 +02:00
|
|
|
|
2018-08-21 00:32:27 +02:00
|
|
|
|
2018-08-09 18:11:45 +02:00
|
|
|
class MISPServerError(PyMISPError):
|
|
|
|
pass
|
2018-09-18 03:37:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
class PyMISPNotImplementedYet(PyMISPError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class PyMISPUnexpectedResponse(PyMISPError):
|
2020-01-30 11:44:13 +01:00
|
|
|
pass
|
2018-12-18 11:04:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PyMISPEmptyResponse(PyMISPError):
|
|
|
|
pass
|