File: exceptions.py

package info (click to toggle)
python-rx 4.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,056 kB
  • sloc: python: 39,070; javascript: 77; makefile: 24
file content (36 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Rx Exceptions


from typing import Optional


class SequenceContainsNoElementsError(Exception):
    def __init__(self, msg: Optional[str] = None):
        super().__init__(msg or "Sequence contains no elements")


class ArgumentOutOfRangeException(ValueError):
    def __init__(self, msg: Optional[str] = None):
        super(ArgumentOutOfRangeException, self).__init__(
            msg or "Argument out of range"
        )


class DisposedException(Exception):
    def __init__(self, msg: Optional[str] = None):
        super().__init__(msg or "Object has been disposed")


class ReEntracyException(Exception):
    def __init__(self, msg: Optional[str] = None):
        super().__init__(msg or "Re-entrancy detected")


class CompletedException(Exception):
    def __init__(self, msg: Optional[str] = None):
        super().__init__(msg or "Observer completed")


class WouldBlockException(Exception):
    def __init__(self, msg: Optional[str] = None):
        super().__init__(msg or "Would block")