48
48
// against the current state before they are run, to ensure that the system
49
49
// meets its guarantees about hook execution order.
50
50
func (s *State) Validate(hi hook.Info) (err error) {
51
defer trivial.ErrorContextf(&err, "inappropriate %q for %q", hi.Kind, hi.RemoteUnit)
51
defer utils.ErrorContextf(&err, "inappropriate %q for %q", hi.Kind, hi.RemoteUnit)
52
52
if hi.RelationId != s.RelationId {
53
53
return fmt.Errorf("expected relation %d, got relation %d", s.RelationId, hi.RelationId)