Update error message tips
This commit is contained in:
@@ -32,18 +32,21 @@ pub fn Status() -> impl IntoView {
|
|||||||
"This shouldn't happen, please create an issue on github."
|
"This shouldn't happen, please create an issue on github."
|
||||||
}
|
}
|
||||||
SQLitendError::OpenDb(_) | SQLitendError::Step(_) => {
|
SQLitendError::OpenDb(_) | SQLitendError::Step(_) => {
|
||||||
"If database disk image is malformed, enable the discard context option and run it once."
|
"If database disk image is malformed, change the context option and run it once."
|
||||||
}
|
}
|
||||||
SQLitendError::Prepare(_) => "Check if the syntax is correct.",
|
SQLitendError::Prepare(_) => "Check if the syntax is correct.",
|
||||||
SQLitendError::UnsupportColumnType(_) => {
|
SQLitendError::UnsupportColumnType(_) => {
|
||||||
"An unsupported type was encountered, please create an issue on github."
|
"An unsupported type was encountered, please create an issue on github."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
WorkerError::NotFound | WorkerError::Unexpected => {
|
WorkerError::NotOpened => {
|
||||||
|
"This is most likely to happen only on OPFS VFS, switch VFS and try again."
|
||||||
|
}
|
||||||
|
WorkerError::Unexpected => {
|
||||||
"This shouldn't happen, please create an issue on github."
|
"This shouldn't happen, please create an issue on github."
|
||||||
}
|
}
|
||||||
WorkerError::InvaildState => {
|
WorkerError::InvaildState => {
|
||||||
"SQLite is in an abnormal state when executing sql, enable the discard context option and run it once."
|
"SQLite is in an abnormal state when executing sql, change the context option and run it once."
|
||||||
}
|
}
|
||||||
WorkerError::LoadDb(_) => "Check whether the imported DB is a SQLite3 file.",
|
WorkerError::LoadDb(_) => "Check whether the imported DB is a SQLite3 file.",
|
||||||
WorkerError::DownloadDb(_) => "It may be caused by OOM.",
|
WorkerError::DownloadDb(_) => "It may be caused by OOM.",
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ impl SQLightError {
|
|||||||
pub enum WorkerError {
|
pub enum WorkerError {
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
SQLite(#[from] SQLitendError),
|
SQLite(#[from] SQLitendError),
|
||||||
#[error("Not found database")]
|
#[error("DB is not opened")]
|
||||||
NotFound,
|
NotOpened,
|
||||||
#[error("Execute sqlite with invaild state")]
|
#[error("Execute sqlite with invaild state")]
|
||||||
InvaildState,
|
InvaildState,
|
||||||
#[error("OPFS already opened")]
|
#[error("OPFS already opened")]
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ async fn with_worker<F, T>(mut f: F) -> Result<T>
|
|||||||
where
|
where
|
||||||
F: FnMut(&mut SQLiteWorker) -> Result<T>,
|
F: FnMut(&mut SQLiteWorker) -> Result<T>,
|
||||||
{
|
{
|
||||||
f(DB.lock().await.as_mut().ok_or(WorkerError::NotFound)?)
|
f(DB.lock().await.as_mut().ok_or(WorkerError::NotOpened)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn init_opfs_util() -> Result<&'static OpfsSAHPoolUtil> {
|
async fn init_opfs_util() -> Result<&'static OpfsSAHPoolUtil> {
|
||||||
|
|||||||
Reference in New Issue
Block a user