refactor(entrypoint): propagate errors from route registration and stream serving

Changed AddRoute and ListenAndServe methods to return errors instead of logging them internally and continuing. This allows callers to properly handle and propagate errors, improving error visibility and enabling better error management across the codebase. Updated all callers in fileserver, reverse_proxy, stream routes to handle these errors appropriately.
This commit is contained in:
yusing
2026-02-07 21:06:22 +08:00
parent 65cfa90c95
commit 1705f77060
9 changed files with 43 additions and 40 deletions

View File

@@ -10,7 +10,7 @@ type Entrypoint interface {
DisablePoolsLog(v bool)
GetRoute(alias string) (types.Route, bool)
AddRoute(r types.Route)
AddRoute(r types.Route) error
IterRoutes(yield func(r types.Route) bool)
NumRoutes() int
RoutesByProvider() map[string][]types.Route