github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/worker/uniter/runner/context/errors.go (about)

     1  // Copyright 2012-2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package context
     5  
     6  import (
     7  	"github.com/juju/errors"
     8  )
     9  
    10  var ErrRequeueAndReboot = errors.New("reboot now")
    11  var ErrReboot = errors.New("reboot after hook")
    12  var ErrNoProcess = errors.New("no process to kill")
    13  
    14  type missingHookError struct {
    15  	hookName string
    16  }
    17  
    18  func (e *missingHookError) Error() string {
    19  	return e.hookName + " does not exist"
    20  }
    21  
    22  func IsMissingHookError(err error) bool {
    23  	_, ok := err.(*missingHookError)
    24  	return ok
    25  }
    26  
    27  func NewMissingHookError(hookName string) error {
    28  	return &missingHookError{hookName}
    29  }