mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-22 00:59:11 +01:00
fix(route): improve error handling in route.Start method
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user