Source code for illumio.exceptions
# -*- coding: utf-8 -*-
"""This module provides common exception classes used throughout the application.
Copyright:
© 2022 Illumio
License:
Apache2, see LICENSE for more details.
"""
[docs]class IllumioApiException(IllumioException):
"""Superclass for exceptions generated by the Illumio API code."""
[docs]class IllumioIntegerValidationException(IllumioException):
"""Raised when invalid integer values are provided."""
def __init__(self, val, minimum: int, maximum: int, message="") -> None:
if not message:
message = "Invalid value {} - must be integer between {} and {}".format(
val, minimum, maximum
)
super().__init__(message)
__all__ = [
'IllumioException',
'IllumioApiException',
'IllumioIntegerValidationException',
]