fix(web): return startup errors instead of panicking (#1620)

Replace server startup panics with returned errors, print actionable CLI
messages with exit status 1, and clarify the API token flags.

Add regressions for missing web authentication credentials.

Fixes GopeedLab/gopeed#1614
This commit is contained in:
OKAN TIKTAS authored and GitHub committed 2026-10-26 18:05:56 +08:00
1 parent 903c5c46c4
commit 7d423e2182
5 files changed
+55 -9

No files matched your search

+7 -1
View File
@@ -1,6 +1,9 @@
package main
import (
"fmt"
"os"
"github.com/GopeedLab/gopeed/cmd"
"github.com/GopeedLab/gopeed/pkg/rest/model"
)
@@ -13,5 +16,8 @@ func main() {
Storage: model.StorageBolt,
WebEnable: true,
}
cmd.Start(cfg)
if err := cmd.Start(cfg); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}