8. Exceptions¶
Custom exceptions for wpostgresql.
- exception wpostgresql.exceptions.WPostgreSQLError[source]¶
Bases:
ExceptionBase exception for wpostgresql errors.
- exception wpostgresql.exceptions.ConnectionError[source]¶
Bases:
WPostgreSQLErrorException raised for connection errors.
- exception wpostgresql.exceptions.TableSyncError[source]¶
Bases:
WPostgreSQLErrorException raised during table synchronization.
- exception wpostgresql.exceptions.ValidationError[source]¶
Bases:
WPostgreSQLErrorException raised for validation errors.
- exception wpostgresql.exceptions.OperationError[source]¶
Bases:
WPostgreSQLErrorException raised for database operation errors.
- exception wpostgresql.exceptions.SQLInjectionError[source]¶
Bases:
WPostgreSQLErrorException raised when SQL injection is detected.
- exception wpostgresql.exceptions.TransactionError[source]¶
Bases:
WPostgreSQLErrorException raised for transaction errors.
8.1. Exception Hierarchy¶
wpostgresql.WPostgreSQLErrorwpostgresql.ConnectionErrorwpostgresql.TableSyncErrorwpostgresql.ValidationErrorwpostgresql.OperationErrorwpostgresql.SQLInjectionErrorwpostgresql.TransactionError
8.2. Usage Example¶
from wpostgresql import WPostgreSQL, ConnectionError
try:
db = WPostgreSQL(User, db_config)
except ConnectionError as e:
print(f"Failed to connect: {e}")