-
Notifications
You must be signed in to change notification settings - Fork 972
Rust CLI tool panics on invalid TOML config instead of showing helpful error message #4749
Copy link
Copy link
Open
Description
Description
When the spacetime.toml config file contains invalid TOML syntax, the CLI panics with an unhelpful stack trace instead of providing a user-friendly error message pointing to the syntax error.
Steps to Reproduce
- Create a new SpacetimeDB project:
spacetime init my-project --lang rust
cd my-project
- Introduce a syntax error in spacetime.toml:
[module]
name = "my-project
# Missing closing quote above
- Run any CLI command:
spacetime build
Expected Behavior
The CLI should catch the TOML parsing error and display:
Error: Invalid TOML syntax in spacetime.toml
--> spacetime.toml:2:8
|
2 | name = "my-project
| ^ unterminated string
Help: Check your spacetime.toml for syntax errors
Actual Behavior
The CLI panics with:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { ... }
stack backtrace:
0: rust_begin_unwind
...
Environment
- SpacetimeDB version: 1.11.3
- OS: Windows 11 / WSL Ubuntu 22.04
- Rust: 1.83.0
Additional Context
This affects new users disproportionately. Better error handling for config parsing would significantly improve the DX. Similar pattern exists in tools like cargo which provides excellent TOML error messages.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels