Skip to content

Commit

Permalink
Fixed behaviour of boltdb routing table to return error when rule doe…
Browse files Browse the repository at this point in the history
…s not exist.
  • Loading branch information
Evan Lin committed Sep 6, 2019
1 parent e0b423b commit fa918df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/routing/boltdb_routing_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ func (rt *boltDBRoutingTable) Rule(routeID RouteID) (Rule, error) {
rule = b.Get(binaryID(routeID))
return nil
})

if rule == nil {
return nil, fmt.Errorf("rule of routeID '%v' does not exist", routeID)
}
return rule, err
}

Expand Down

0 comments on commit fa918df

Please sign in to comment.