msticpy.common.exceptions module
Miscellaneous helper methods for Jupyter Notebooks.
- exception msticpy.common.exceptions.MsticpyAzureConfigError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserConfigErrorException class for AzureData.
Create Azure data missing configuration exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Using the Azure API connector', 'https://msticpy.readthedocs.io/en/latest/data_acquisition/AzureData.html#instantiating-and-connecting-with-an-azure-data-connector')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyAzureConnectionError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for Azure Connection errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Connecting to Microsoft Sentinel', 'https://msticpy.readthedocs.io/en/latest/data_acquisition/AzureData.html#instantiating-and-connecting-with-an-azure-data-connector')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyConfigError
Bases:
MsticpyExceptionConfiguration exception class for msticpy.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyConnectionError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for KqlConnection errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('DataProviders', 'https://msticpy.readthedocs.io/en/latest/data_acquisition/DataProviders.html')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyDataQueryError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for data query errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Query failed', 'https://msticpy.readthedocs.io/en/latest/DataAcquisition.html#querying-and-importing-data')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyException
Bases:
ExceptionDefault exception class for msticpy.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyImportExtraError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserError,ImportErrorException class for Imports that need an extra.
Create import missing extra exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
extra (str) – The name of the setup extra that needs to be installed.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Installing msticpy', 'https://msticpy.readthedocs.io/en/latest/getting_started/Installing.html')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- msg
exception message
- name
module name
- name_from
name imported from module
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- path
module path
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyKeyVaultConfigError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserConfigErrorKey Vault configuration exception.
Create Key Vault configuration exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Using keyvault to store msticpy secrets', 'https://msticpy.readthedocs.io/en/latest/getting_started/msticpyconfig.html#specifying-secrets-as-key-vault-secrets')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyKeyVaultMissingSecretError(*args, help_uri=None, **kwargs)
Bases:
MsticpyKeyVaultConfigErrorMissing secret exception.
Create Key Vault missing key exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Using keyvault to store msticpy secrets', 'https://msticpy.readthedocs.io/en/latest/getting_started/msticpyconfig.html#specifying-secrets-as-key-vault-secrets')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyKqlConnectionError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for KqlConnection errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Connecting to Microsoft Sentinel', 'https://msticpy.readthedocs.io/en/latest/data_acquisition/DataProviders.html#connecting-to-an-azure-sentinel-workspace')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyMissingDependencyError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserError,ImportErrorException class for Imports that are not installed.
Create import missing extra exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
packages (Union[str, list[str]]) – The name of the packages or list of packages that need(s) to be installed.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Installing msticpy', 'https://msticpy.readthedocs.io/en/latest/getting_started/Installing.html')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- msg
exception message
- name
module name
- name_from
name imported from module
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- path
module path
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyNoDataSourceError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for missing data source errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Querying and importing data', 'https://msticpy.readthedocs.io/en/latest/DataAcquisition.html#querying-and-importing-data')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyNotConnectedError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for NotConnected errors.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Querying and importing data', 'https://msticpy.readthedocs.io/en/latest/DataAcquisition.html#querying-and-importing-data')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyParameterError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorException class for missing/incorrect parameters.
Create parameter exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
parameters (Union[str, list[str]) – The name of the bad parameter(s).
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('MSTICPy documentation', 'https://msticpy.readthedocs.io')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyResourceError
Bases:
MsticpyExceptionException class for resource errors.
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyUserConfigError(*args, help_uri=None, **kwargs)
Bases:
MsticpyUserErrorConfiguration user exception class for msticpy.
Create generic user configuration exception.
- Parameters:
help_uri (Union[tuple[str, str], str, None], optional) – Override the default help URI.
- Return type:
None
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('Configuring msticpy', 'https://msticpy.readthedocs.io/en/latest/getting_started/msticpyconfig.html')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- exception msticpy.common.exceptions.MsticpyUserError(*args, help_uri=None, **kwargs)
Bases:
MsticpyExceptionMsticpy User exception displaying friendly message.
Create an instance of the MsticpyUserError class.
- Parameters:
args (Iterable of strings) – Args will be printed as text of the exception.
help_uri (Union[tuple[str, str], str, None], optional) – Primary URL, by default “https://msticpy.readthedocs.org”
title (str, optional) – If a title keyword argument is supplied it will be used to create the title line.
*_uri (str, optional) – Additional keyword arguments who’s names end in “_uri” will be used to create a list of references in addition to the primary help_uri
display (bool, optional) – Display the exception when created. By default, False
Notes
The exception text is displayed when the exception is created and not when it is raised. We recommend creating the exception within the raise statement. E.g.
raise MsticpyUserException(arg1, arg2…)
Developer note: Any classes derived from MsticpyUserError should be named with an “Error” suffix to distinguish these from standard exception types.
- DEF_HELP_URI: ClassVar[tuple[str, str]] = ('msticpy documentation', 'https://msticpy.readthedocs.org')
- add_note()
Exception.add_note(note) – add a note to the exception
- args
- display_exception()
Output the exception HTML or text friendly exception.
- Return type:
None
- property help_uri: tuple[str, str] | str
Get the default help URI.
- classmethod no_display_exceptions()
Context manager to block exception display to IPython/stdout.
- Return type:
Generator[None, Any, None]
- with_traceback()
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.