From 23d392d88b09074ff4745b9a23febe770d220207 Mon Sep 17 00:00:00 2001 From: yusing Date: Mon, 8 Sep 2025 08:53:46 +0800 Subject: [PATCH] fix(route): improve error handling in route.Start method --- internal/route/route.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/route/route.go b/internal/route/route.go index a1dea29b..ad9dcd94 100644 --- a/internal/route/route.go +++ b/internal/route/route.go @@ -272,11 +272,14 @@ func (r *Route) Task() *task.Task { return r.task } -func (r *Route) Start(parent task.Parent) (err gperr.Error) { +func (r *Route) Start(parent task.Parent) gperr.Error { + if r.lastError != nil { + return r.lastError + } r.once.Do(func() { - err = r.start(parent) + r.lastError = r.start(parent) }) - return + return r.lastError } func (r *Route) start(parent task.Parent) gperr.Error {