Skip to content

fix: clean error instead of panic when no config can be found - #19

Merged
desbma merged 1 commit into
desbma:masterfrom
usefulish:pr/config-error-chain
Aug 7, 2026
Merged

desbma merged 1 commit into
desbma:masterfrom
usefulish:pr/config-error-chain

Conversation

@usefulish

Copy link
Copy Markdown
Contributor

Config::default() unwraps when the Syncthing config cannot be found, so the daemon exits with a panic and backtrace instead of a readable error. Propagate the error through parse() instead, preserving the existing context message.

No test: simulating "no config anywhere" requires mutating process-global env vars, which would race with parallel tests. Verified by hand that the full error chain is printed and the process exits 1:

WARN  [stfed::config] Unable to find config file, using default config
Error: Failed to read local config

Caused by:
    0: Unable to guess stfed configuration field values from Synthing config, please write a config file
    1: Unable fo find Synthing config file

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@usefulish usefulish closed this Aug 7, 2026
@usefulish usefulish reopened this Aug 7, 2026
@desbma
desbma merged commit 5be442b into desbma:master Aug 7, 2026
8 checks passed
@usefulish
usefulish deleted the pr/config-error-chain branch August 7, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants