pub struct DbError { /* private fields */ }
Expand description
Oracle database error or ODPI-C error
Implementations§
Source§impl DbError
impl DbError
Sourcepub fn new<M, F, A>(
code: i32,
offset: u32,
message: M,
fn_name: F,
action: A,
) -> DbError
pub fn new<M, F, A>( code: i32, offset: u32, message: M, fn_name: F, action: A, ) -> DbError
Creates a new DbError. Note that its is_recoverable
and is_warning
values are always false
.
Sourcepub fn code(&self) -> i32
pub fn code(&self) -> i32
The OCI error code if an OCI error has taken place. If no OCI error has taken place the value is 0.
Sourcepub fn offset(&self) -> u32
pub fn offset(&self) -> u32
The parse error offset (in bytes) when executing a statement or the row offset when performing bulk operations or fetching batch error information. If neither of these cases are true, the value is 0.
Sourcepub fn fn_name(&self) -> &str
pub fn fn_name(&self) -> &str
The public ODPI-C, used by rust-oracle, function name which was called in which the error took place.
Sourcepub fn action(&self) -> &str
pub fn action(&self) -> &str
The internal action that was being performed when the error took place.
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
A boolean value indicating if the error is recoverable. This always retruns false
unless both client and server are at release 12.1 or higher.
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
A boolean value indicating if the error information is for a warning returned by Oracle that does not prevent the requested operation from proceeding. Examples include connecting to the database with a password that is about to expire (within the grace period) and creating a stored procedure with compilation errors.
See also Connection::last_warning
.