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

@@ -6,7 +6,7 @@ import (
)
type Stream interface {
ListenAndServe(ctx context.Context, preDial, onRead HookFunc)
ListenAndServe(ctx context.Context, preDial, onRead HookFunc) error
LocalAddr() net.Addr
Close() error
}