RoutineAssertionException
class RoutineAssertionException(val reason: RoutineAssertionExceptionReason, sqlState: String, serverErrorMessage: ServerErrorMessage) : OctaviusException
Exception thrown when an assertion inside a PL/pgSQL routine turns out to be false.
INTO STRICT states that the query matches exactly one row, and ASSERT states its condition holds. A run that finds otherwise has falsified something the routine claimed, which makes this a defect in the database code rather than an outcome of the call - the same reading that has fetch*Strict finding no row raise InvalidOperationException with INCORRECT_RESULT_SIZE instead of returning null. This is that failure one level down, asserted in PL/pgSQL rather than in Kotlin.
A routine saying no on purpose is RoutineRaiseException and is deliberately a different type.
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: RoutineAssertionExceptionReason, sqlState: String, serverErrorMessage: ServerErrorMessage)