Coverage for sqlalchemy_crud_plus\errors.py: 96%
26 statements
« prev ^ index » next coverage.py v7.11.1, created at 2025-11-26 11:02 +0800
« prev ^ index » next coverage.py v7.11.1, created at 2025-11-26 11:02 +0800
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
5class SQLAlchemyCRUDPlusException(Exception):
6 def __init__(self, msg: str) -> None:
7 self.msg = msg
9 def __str__(self) -> str:
10 return self.msg
13class ModelColumnError(SQLAlchemyCRUDPlusException):
14 """Error raised when an SCP column is invalid."""
16 def __init__(self, msg: str) -> None:
17 super().__init__(msg)
20class SelectOperatorError(SQLAlchemyCRUDPlusException):
21 """Error raised when a select expression is invalid."""
23 def __init__(self, msg: str) -> None:
24 super().__init__(msg)
27class ColumnSortError(SQLAlchemyCRUDPlusException):
28 """Error raised when a column sorting is invalid."""
30 def __init__(self, msg: str) -> None:
31 super().__init__(msg)
34class MultipleResultsError(SQLAlchemyCRUDPlusException):
35 """Error raised when multiple results are invalid."""
37 def __init__(self, msg: str) -> None:
38 super().__init__(msg)
41class CompositePrimaryKeysError(SQLAlchemyCRUDPlusException):
42 """Error raised when a table have Composite primary keys."""
44 def __init__(self, msg: str) -> None:
45 super().__init__(msg)
48class LoadingStrategyError(SQLAlchemyCRUDPlusException):
49 """Error raised when a loading strategy is invalid."""
51 def __init__(self, msg: str) -> None:
52 super().__init__(msg)
55class JoinConditionError(SQLAlchemyCRUDPlusException):
56 """Error raised when a join operation is invalid."""
58 def __init__(self, msg: str) -> None:
59 super().__init__(msg)