diff --git a/src/app/output/status.rs b/src/app/output/status.rs index 1b7c9cd..29c1b4f 100644 --- a/src/app/output/status.rs +++ b/src/app/output/status.rs @@ -32,18 +32,21 @@ pub fn Status() -> impl IntoView { "This shouldn't happen, please create an issue on github." } 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::UnsupportColumnType(_) => { "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." } 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::DownloadDb(_) => "It may be caused by OOM.", diff --git a/src/lib.rs b/src/lib.rs index e0fc720..fe8b049 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -77,8 +77,8 @@ impl SQLightError { pub enum WorkerError { #[error(transparent)] SQLite(#[from] SQLitendError), - #[error("Not found database")] - NotFound, + #[error("DB is not opened")] + NotOpened, #[error("Execute sqlite with invaild state")] InvaildState, #[error("OPFS already opened")] diff --git a/src/worker/mod.rs b/src/worker/mod.rs index 3b6f598..7d46e93 100644 --- a/src/worker/mod.rs +++ b/src/worker/mod.rs @@ -49,7 +49,7 @@ async fn with_worker(mut f: F) -> Result where F: FnMut(&mut SQLiteWorker) -> Result, { - 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> {