From 0e7de55cdcf71b0c8a5e6fd1f44ab0576654e122 Mon Sep 17 00:00:00 2001 From: Maxime Lagresle Date: Tue, 28 Sep 2021 21:56:57 +0200 Subject: [PATCH] return an error instead of panicking when failing to get edge Signed-off-by: Maxime Lagresle --- solver/scheduler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solver/scheduler.go b/solver/scheduler.go index 8de4d694e4b4c..2ec63dad52806 100644 --- a/solver/scheduler.go +++ b/solver/scheduler.go @@ -351,7 +351,9 @@ type pipeFactory struct { func (pf *pipeFactory) NewInputRequest(ee Edge, req *edgeRequest) pipe.Receiver { target := pf.s.ef.getEdge(ee) if target == nil { - panic("failed to get edge") // TODO: return errored pipe + return pf.NewFuncRequest(func(_ context.Context) (interface{}, error) { + return req, errors.Errorf("failed to get edge") + }) } p := pf.s.newPipe(target, pf.e, pipe.Request{Payload: req}) if debugScheduler {