Skip to content

Exceptions

sqlalchemy_bind_manager.exceptions

sqlalchemy_bind_manager.exceptions.NotInitializedBindError

Raised when a bind object does not exist (i.e. not yet initialized)

Source code in sqlalchemy_bind_manager/exceptions.py
22
23
24
25
26
27
class NotInitializedBindError(Exception):
    """
    Raised when a bind object does not exist (i.e. not yet initialized)
    """

    pass

sqlalchemy_bind_manager.exceptions.UnsupportedBindError

Raised when the internal session handler is given an unsupported bind object. Usually it happens when Async and Sync implementation are mixed up (i.e. initializing an AsyncUnitOfWork instance with a Sync bind)

Source code in sqlalchemy_bind_manager/exceptions.py
30
31
32
33
34
35
36
37
class UnsupportedBindError(Exception):
    """
    Raised when the internal session handler is given an unsupported bind object.
    Usually it happens when Async and Sync implementation are mixed up
    (i.e. initializing an `AsyncUnitOfWork` instance with a Sync bind)
    """

    pass

sqlalchemy_bind_manager.exceptions.InvalidConfigError

Raised when a class is initialized with an invalid configuration and/or parameters.

Source code in sqlalchemy_bind_manager/exceptions.py
40
41
42
43
44
45
class InvalidConfigError(Exception):
    """
    Raised when a class is initialized with an invalid configuration and/or parameters.
    """

    pass

sqlalchemy_bind_manager.exceptions.ModelNotFoundError

Raised when a Repository is not able to find a model using the provided primary key.

Source code in sqlalchemy_bind_manager/exceptions.py
48
49
50
51
52
53
class ModelNotFoundError(Exception):
    """
    Raised when a Repository is not able to find a model using the provided primary key.
    """

    pass

sqlalchemy_bind_manager.exceptions.InvalidModelError

Raised when an invalid model is passed to a Repository object or class.

i.e.:

  • Trying to instantiate a repository with a non SQLAlchemy model
  • Trying to save a model belonging to another Repository class
Source code in sqlalchemy_bind_manager/exceptions.py
56
57
58
59
60
61
62
63
64
65
66
class InvalidModelError(Exception):
    """
    Raised when an invalid model is passed to a Repository object or class.

    i.e.:

     * Trying to instantiate a repository with a non SQLAlchemy model
     * Trying to save a model belonging to another Repository class
    """

    pass

sqlalchemy_bind_manager.exceptions.UnmappedPropertyError

Raised when trying to execute queries using not mapped column names. (i.e. passing a non-existing column to search_params or order_by parameters when invoking find())

Source code in sqlalchemy_bind_manager/exceptions.py
69
70
71
72
73
74
75
76
class UnmappedPropertyError(Exception):
    """
    Raised when trying to execute queries using not mapped column names.
    (i.e. passing a non-existing column to `search_params`
    or `order_by` parameters when invoking `find()`)
    """

    pass

sqlalchemy_bind_manager.exceptions.RepositoryNotFoundError

Raised when trying to use a repository that has not been registered with the unit of work instance.

Source code in sqlalchemy_bind_manager/exceptions.py
79
80
81
82
83
84
85
class RepositoryNotFoundError(Exception):
    """
    Raised when trying to use a repository that has not been registered
    with the unit of work instance.
    """

    pass