MCPcopy Create free account
hub / github.com/astercloud/aster / HandleFailure

Method HandleFailure

pkg/actor/supervisor.go:312–323  ·  view source on GitHub ↗

HandleFailure 实现 SupervisorStrategy

(system *System, child *PID, msg Message, err any)

Source from the content-addressed store, hash-verified

310
311// HandleFailure 实现 SupervisorStrategy
312func (s *CompositeStrategy) HandleFailure(system *System, child *PID, msg Message, err any) any {
313 // 尝试匹配错误类型
314 if e, ok := err.(error); ok {
315 errType := e.Error()
316 if strategy, found := s.strategies[errType]; found {
317 return strategy.HandleFailure(system, child, msg, err)
318 }
319 }
320
321 // 使用回退策略
322 return s.fallback.HandleFailure(system, child, msg, err)
323}
324
325// ============== 监督树辅助 ==============
326

Callers

nothing calls this directly

Calls 2

ErrorMethod · 0.65
HandleFailureMethod · 0.65

Tested by

no test coverage detected