github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/worker/errors.go (about)

     1  // Copyright 2012-2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package worker
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  )
     9  
    10  // These errors are returned by various specific workers in the hope that they
    11  // will have some specific effect on the top-level agent running that worker.
    12  //
    13  // It should be clear that they don't belong here, and certainly shouldn't be
    14  // used as they are today: e.g. a uniter has *no fricking idea* whether its
    15  // host agent should shut down. A uniter can return ErrUnitDead, and its host
    16  // might need to respond to that, perhaps by returning an error specific to
    17  // *its* host; depending on these values punching right through N layers (but
    18  // only when we want them to!) is kinda terrible.
    19  var (
    20  	ErrTerminateAgent  = errors.New("agent should be terminated")
    21  	ErrRebootMachine   = errors.New("machine needs to reboot")
    22  	ErrShutdownMachine = errors.New("machine needs to shutdown")
    23  )