diff --git a/Cargo.lock b/Cargo.lock index a8b0326d..c9c50fa1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -693,9 +693,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bigdecimal" @@ -3058,6 +3058,20 @@ dependencies = [ "objc2-foundation", ] +[[package]] +name = "odbc-api" +version = "18.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc090834b2158b276ee4a5b09224282c20db4db40096607d7b3b94e2f7cfef6" +dependencies = [ + "atoi", + "log", + "odbc-sys", + "thiserror 2.0.17", + "widestring", + "winit", +] + [[package]] name = "odbc-api" version = "19.1.0" @@ -4234,6 +4248,7 @@ dependencies = [ "async-trait", "awc", "base64 0.22.1", + "base64ct", "bigdecimal", "chrono", "clap", @@ -4251,6 +4266,7 @@ dependencies = [ "log", "markdown", "mime_guess", + "odbc-api 18.0.1", "odbc-sys", "openidconnect", "password-hash", @@ -4330,7 +4346,7 @@ dependencies = [ "md-5", "memchr", "num-bigint", - "odbc-api", + "odbc-api 19.1.0", "once_cell", "paste", "percent-encoding", diff --git a/src/filesystem.rs b/src/filesystem.rs index 19e544b1..d40a61a8 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -111,7 +111,23 @@ impl FileSystem { (Ok(f), _) => Ok(f), (Err(e), Some(db_fs)) if e.kind() == ErrorKind::NotFound => { // no local file, try the database - db_fs.read_file(app_state, path.as_ref()).await + match db_fs.read_file(app_state, path.as_ref()).await { + Ok(f) => Ok(f), + Err(e) => { + let e_str = format!("{e:#}"); + if e_str.contains("doesn't exist") + || e_str.contains("no such table") + || e_str.contains("Invalid object name") + { + Err(ErrorWithStatus { + status: actix_web::http::StatusCode::NOT_FOUND, + } + .into()) + } else { + Err(e) + } + } + } } (Err(e), None) if e.kind() == ErrorKind::NotFound => Err(ErrorWithStatus { status: actix_web::http::StatusCode::NOT_FOUND,