Bradyphrenia / biene

elektronische Stockkarte
1 stars 0 forks source link

App panics immediately after starting #7

Open Bradyphrenia opened 3 months ago

Bradyphrenia commented 3 months ago

steffen@iMac biene % npm run tauri dev

bees@0.0.0 tauri tauri dev

 Running BeforeDevCommand (`npm run dev`)

bees@0.0.0 dev vite

VITE v4.5.3 ready in 236 ms

➜ Local: http://localhost:1420/ ➜ Network: use --host to expose Info Watching /Users/steffen/IdeaProjects/biene/src-tauri for changes... Compiling bees v0.1.0 (/Users/steffen/IdeaProjects/biene/src-tauri) warning: function get_from_db is never used --> src/commands.rs:88:8 88 pub fn get_from_db() { ^^^^^^^^^^^

= note: #[warn(dead_code)] on by default

warning: function add_to_db is never used --> src/commands.rs:93:8 | 93 | pub fn add_to_db() { | ^^^^^^^^^

warning: function update_db_entry is never used --> src/commands.rs:98:8 | 98 | pub fn update_db_entry() { | ^^^^^^^^^^^^^^^

warning: function connect is never used --> src/database/handler.rs:6:8 | 6 | pub fn connect(db_settings: &Database) -> Result<Client, String> { | ^^^^^^^

warning: function disconnect is never used --> src/database/handler.rs:26:8 | 26 | pub fn disconnect() { | ^^^^^^^^^^

warning: associated function new is never used --> src/database/structs.rs:13:8 | 12 | impl Database { | ------------- associated function in this implementation 13 | fn new() -> Self { | ^^^

warning: function get_from_store is never used --> src/frontend/commands.rs:8:4 | 8 | fn get_from_store( | ^^^^^^^^^^^^^^

warning: function get_db_from_store is never used --> src/frontend/commands.rs:19:4 | 19 | fn get_db_from_store( | ^^^^^^^^^^^^^^^^^

warning: function test_db_connection is never used --> src/frontend/commands.rs:37:8 | 37 | pub fn test_db_connection( | ^^^^^^^^^^^^^^^^^^

warning: associated function new is never used --> src/util/structs.rs:26:8 | 25 | impl Database { | ------------- associated function in this implementation 26 | fn new() -> Self { | ^^^

warning: bees (bin "bees") generated 10 warnings Finished dev [unoptimized + debuginfo] target(s) in 1.23s 2024-04-01T17:39:04.590Z INFO [bees] Starting biene RemoteLayerTreeDrawingAreaProxyMac::scheduleDisplayLink(): page has no displayID RemoteLayerTreeDrawingAreaProxyMac::scheduleDisplayLink(): page has no displayID 2024-04-01T17:39:05.458Z WARN [tauri_plugin_store] Failed to load store ".settings.dat" from disk: No such file or directory (os error 2). Falling back to default values. thread 'main' panicked at src/util/store.rs:26:70: called Result::unwrap() on an Err value: Error("invalid type: null, expected struct Database", line: 0, column: 0) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5 steffen@iMac biene %

kingkaos commented 3 months ago

So, the reason is the missing store file. The app tries to read the database credentials but finds None due to missing or not found file. This is an invalid type and thus the application panics.

I'm working on that.