mirror of
https://github.com/isar/rusqlite.git
synced 2025-04-21 09:17:47 +08:00
Use a default error message instead
This commit is contained in:
parent
d142c00a1c
commit
530292d873
@ -130,7 +130,7 @@ pub enum Error {
|
|||||||
/// error code
|
/// error code
|
||||||
error: ffi::Error,
|
error: ffi::Error,
|
||||||
/// error message
|
/// error message
|
||||||
msg: Option<String>,
|
msg: String,
|
||||||
/// SQL input
|
/// SQL input
|
||||||
sql: String,
|
sql: String,
|
||||||
/// byte offset of the start of invalid token
|
/// byte offset of the start of invalid token
|
||||||
@ -324,7 +324,7 @@ impl fmt::Display for Error {
|
|||||||
offset,
|
offset,
|
||||||
ref sql,
|
ref sql,
|
||||||
..
|
..
|
||||||
} => write!(f, "{msg:?} in {sql} at offset {offset}"),
|
} => write!(f, "{msg} in {sql} at offset {offset}"),
|
||||||
#[cfg(feature = "loadable_extension")]
|
#[cfg(feature = "loadable_extension")]
|
||||||
Self::InitError(ref err) => err.fmt(f),
|
Self::InitError(ref err) => err.fmt(f),
|
||||||
#[cfg(feature = "modern_sqlite")]
|
#[cfg(feature = "modern_sqlite")]
|
||||||
@ -457,7 +457,7 @@ pub unsafe fn error_with_offset(db: *mut ffi::sqlite3, code: c_int, sql: &str) -
|
|||||||
if offset >= 0 {
|
if offset >= 0 {
|
||||||
return Error::SqlInputError {
|
return Error::SqlInputError {
|
||||||
error,
|
error,
|
||||||
msg,
|
msg: msg.unwrap_or("error".to_owned()),
|
||||||
sql: sql.to_owned(),
|
sql: sql.to_owned(),
|
||||||
offset,
|
offset,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user