ServerErrorMessage

data class ServerErrorMessage(val severity: String, val localizedSeverity: String, val code: String, val message: String, val detail: String?, val hint: String?, val position: Int?, val internalPosition: Int?, val internalQuery: String?, val where: String?, val schema: String?, val table: String?, val column: String?, val datatype: String?, val constraint: String?, val file: String?, val line: Int?, val routine: String?)

A publicly exposed data class containing all detailed fields provided by the PostgreSQL backend when an error occurs.

Reachable as OctaviusException.serverErrorMessage on any exception the server raised, and the place to look when the driver's own categorization is not specific enough

Constructors

Link copied to clipboard
constructor(severity: String, localizedSeverity: String, code: String, message: String, detail: String?, hint: String?, position: Int?, internalPosition: Int?, internalQuery: String?, where: String?, schema: String?, table: String?, column: String?, datatype: String?, constraint: String?, file: String?, line: Int?, routine: String?)

Types

Link copied to clipboard
internal object Companion

Properties

Link copied to clipboard

The five-character SQLSTATE.

Link copied to clipboard

The column at fault.

Link copied to clipboard

The constraint that was violated.

Link copied to clipboard

The data type at fault.

Link copied to clipboard

Secondary detail carrying more about the problem.

Link copied to clipboard
val file: String?

The PostgreSQL source file that reported it - server internals, not your SQL.

Link copied to clipboard
val hint: String?

A suggestion of what to do about it.

Link copied to clipboard

The equivalent position within internalQuery, for an error raised inside a statement the server generated itself.

Link copied to clipboard

The server-generated statement the error arose in, such as the body of a PL/pgSQL function.

Link copied to clipboard
val line: Int?

The line in that source file.

Link copied to clipboard

The same severity as the server translated it, which is what a non-English lc_messages changes. Fit for showing to a person, not for comparing against.

Link copied to clipboard

The primary human-readable message.

Link copied to clipboard

The 1-based character position of the error in the submitted statement.

Link copied to clipboard

The PostgreSQL C function that reported it.

Link copied to clipboard

The schema of the object at fault, for the errors that name one.

Link copied to clipboard

ERROR, FATAL or PANIC, always in English: it is read from the non-localized field, which every server the driver will talk to sends. Safe to compare against as a string.

Link copied to clipboard

The table of the object at fault.

Link copied to clipboard

The call stack the error arose in.