refactor(logging): replace log.Fatalf with log.Errorf and add error handling paths

This commit is contained in:
Luis Pater
2025-12-09 17:16:30 +08:00
parent 92df0cada9
commit c600519fa4
6 changed files with 85 additions and 52 deletions

View File

@@ -45,12 +45,13 @@ func StartService(cfg *config.Config, configPath string, localPassword string) {
service, err := builder.Build()
if err != nil {
log.Fatalf("failed to build proxy service: %v", err)
log.Errorf("failed to build proxy service: %v", err)
return
}
err = service.Run(runCtx)
if err != nil && !errors.Is(err, context.Canceled) {
log.Fatalf("proxy service exited with error: %v", err)
log.Errorf("proxy service exited with error: %v", err)
}
}