Skip to content

Interrupt

Interrupt exceptions.

Interrupt

Bases: Exception

Interrupt raised inside a process.

Source code in src/asimpy/interrupt.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
class Interrupt(Exception):
    """Interrupt raised inside a process."""

    def __init__(self, cause: Any):
        """
        Construct interruption exception.

        Args:
            cause: reason for interrupt.
        """
        super().__init__()
        self.cause = cause

    def __str__(self):
        """Represent interrupt as string."""
        return f"Interrupt({self.cause})"

__init__(cause)

Construct interruption exception.

Parameters:

Name Type Description Default
cause Any

reason for interrupt.

required
Source code in src/asimpy/interrupt.py
 9
10
11
12
13
14
15
16
17
def __init__(self, cause: Any):
    """
    Construct interruption exception.

    Args:
        cause: reason for interrupt.
    """
    super().__init__()
    self.cause = cause

__str__()

Represent interrupt as string.

Source code in src/asimpy/interrupt.py
19
20
21
def __str__(self):
    """Represent interrupt as string."""
    return f"Interrupt({self.cause})"