Skip to content

Commit

Permalink
return an error instead of panicking when failing to get edge
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Lagresle <[email protected]>
  • Loading branch information
maxlaverse committed Sep 30, 2021
1 parent e839ff7 commit 0e7de55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion solver/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0e7de55

Please sign in to comment.