Fix the exception after DB upload fails while keeping the context
This commit is contained in:
@@ -46,7 +46,7 @@ pub fn Status() -> impl IntoView {
|
||||
"This shouldn't happen, please create an issue on github."
|
||||
}
|
||||
WorkerError::InvaildState => {
|
||||
"SQLite is in an abnormal state when executing SQLite."
|
||||
"SQLite is in an abnormal state when executing SQLite, please enable the discard context option and use it once."
|
||||
}
|
||||
WorkerError::LoadDb(_) => {
|
||||
"Please check whether the imported DB is a SQLite3 file"
|
||||
|
||||
@@ -167,7 +167,11 @@ pub async fn prepare(options: PrepareOptions) -> Result<()> {
|
||||
worker.db = Some(SQLiteDb::open(&worker.open_options.uri())?);
|
||||
}
|
||||
|
||||
let stmts = worker.db.as_ref().unwrap().prepare(&options.sql)?;
|
||||
let stmts = worker
|
||||
.db
|
||||
.as_ref()
|
||||
.ok_or(WorkerError::InvaildState)?
|
||||
.prepare(&options.sql)?;
|
||||
worker.state = SQLiteState::Prepared(PreparedState {
|
||||
stmts,
|
||||
prepared: None,
|
||||
|
||||
Reference in New Issue
Block a user