RoutineAssertionException

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)

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

Explicit DETAIL field provided by PostgreSQL.

Link copied to clipboard

The primary error message the routine raised (the PostgreSQL MESSAGE field).

Link copied to clipboard
val hint: String?

Explicit HINT field provided by PostgreSQL.

Link copied to clipboard
open val message: String?
Link copied to clipboard

The context of the query that resulted in this exception, if applicable.

Link copied to clipboard

Which assertion failed.

Link copied to clipboard

The raw error message received from the database, if applicable.

Link copied to clipboard

The SQL state code associated with the error, if applicable.

Link copied to clipboard

Call stack or context (WHERE field) of the PL/pgSQL execution.

Functions

Link copied to clipboard

Finds the Octavius failure behind this throwable, if there is one.

Link copied to clipboard
open override fun getDetailedMessage(): String

Provides a detailed, human-readable description of the error.

Link copied to clipboard
open override fun toString(): String