ConstraintViolationException
class ConstraintViolationException(val reason: ConstraintViolationExceptionReason, sqlState: String, serverErrorMessage: ServerErrorMessage) : OctaviusException
Exception thrown when a database operation violates a defined constraint (e.g., unique index, foreign key, check constraint).
This exception encapsulates details about the constraint violation, including the specific type of violation (reason), and optional metadata such as the schema, table, column, and constraint name involved in the error.
Parameters
sqlState
The SQL state code returned by the database.
serverErrorMessage
The original error message from the database server.
Constructors
Link copied to clipboard
constructor(reason: ConstraintViolationExceptionReason, sqlState: String, serverErrorMessage: ServerErrorMessage)
Properties
Link copied to clipboard
The specific name of the constraint that was violated, if available.
Link copied to clipboard
The context of the query that resulted in this exception, if applicable.
Link copied to clipboard
The specific type of constraint violation mapped from the database error.
Link copied to clipboard
The raw error message received from the database, if applicable.