Struct postgres::error::DbError [] [src]

pub struct DbError {
    pub severity: String,
    pub code: SqlState,
    pub message: String,
    pub detail: Option<String>,
    pub hint: Option<String>,
    pub position: Option<ErrorPosition>,
    pub where_: Option<String>,
    pub schema: Option<String>,
    pub table: Option<String>,
    pub column: Option<String>,
    pub datatype: Option<String>,
    pub constraint: Option<String>,
    pub file: String,
    pub line: u32,
    pub routine: String,
    // some fields omitted
}

A Postgres error or notice.

Fields

severity

The field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized translation of one of these.

code

The SQLSTATE code for the error.

message

The primary human-readable error message. This should be accurate but terse (typically one line).

detail

An optional secondary error message carrying more detail about the problem. Might run to multiple lines.

hint

An optional suggestion what to do about the problem. This is intended to differ from Detail in that it offers advice (potentially inappropriate) rather than hard facts. Might run to multiple lines.

position

An optional error cursor position into either the original query string or an internally generated query.

where_

An indication of the context in which the error occurred. Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent first.

schema

If the error was associated with a specific database object, the name of the schema containing that object, if any. (PostgreSQL 9.3+)

table

If the error was associated with a specific table, the name of the table. (Refer to the schema name field for the name of the table's schema.) (PostgreSQL 9.3+)

column

If the error was associated with a specific table column, the name of the column. (Refer to the schema and table name fields to identify the table.) (PostgreSQL 9.3+)

datatype

If the error was associated with a specific data type, the name of the data type. (Refer to the schema name field for the name of the data type's schema.) (PostgreSQL 9.3+)

constraint

If the error was associated with a specific constraint, the name of the constraint. Refer to fields listed above for the associated table or domain. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.) (PostgreSQL 9.3+)

file

The file name of the source-code location where the error was reported.

line

The line number of the source-code location where the error was reported.

routine

The name of the source-code routine reporting the error.

Trait Implementations

impl Debug for DbError
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Display for DbError
[src]

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Error for DbError
[src]

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>
1.0.0

Derived Implementations

impl Eq for DbError
[src]

impl PartialEq for DbError
[src]

fn eq(&self, __arg_0: &DbError) -> bool

fn ne(&self, __arg_0: &DbError) -> bool

impl Clone for DbError
[src]

fn clone(&self) -> DbError

fn clone_from(&mut self, source: &Self)
1.0.0