mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-27 06:30:20 +00:00
9cef71b6b9
Previously an invalid `Dioxus.toml` file would yield this error when running e.g. `dx serve`: ``` Error: Failed to load `Dioxus.toml` because: Dioxus.toml parse failed ``` This doesn't give any indication why it failed to parse. This commit updates it to include why the parsing failed, e.g.: ``` Error: Failed to load Dioxus config because: Dioxus.toml missing field `name` for key `application` at line 38 column 1 ``` I initially had it format the message to include `Dioxus.toml:38:1` to be clickable in some terminals, but the location specified didn't always seem particularly relevant to the actual problem so I left it as-is. This also fixes what I believe would be an issue on case-sensitive file systems where if `dioxus.toml` existed it would try to read `Dioxus.toml`. I'm still fairly new to Rust, so the `.as_path()` calls may not be the best way to deal with the fact that the borrow checker wouldn't let me re-use `crate_dir` and `dioxus_conf_file`. I'm open to suggestions! |
||
---|---|---|
.. | ||
autofmt | ||
cli | ||
core | ||
core-macro | ||
desktop | ||
dioxus | ||
dioxus-tui | ||
extension | ||
fermi | ||
fullstack | ||
hooks | ||
hot-reload | ||
html | ||
interpreter | ||
liveview | ||
mobile | ||
native-core | ||
native-core-macro | ||
rink | ||
router | ||
rsx | ||
rsx-rosetta | ||
signals | ||
ssr | ||
web |