~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/worker/uniter/runner/context/errors.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}