Index: worker/uniter/hook/hook.go |
=== modified file 'worker/uniter/hook/hook.go' |
--- worker/uniter/hook/hook.go 2013-09-12 16:29:52 +0000 |
+++ worker/uniter/hook/hook.go 2014-02-10 18:23:58 +0000 |
@@ -5,8 +5,7 @@ |
package hook |
import ( |
- "fmt" |
- |
+ "launchpad.net/errgo/errors" |
"launchpad.net/juju-core/charm/hooks" |
) |
@@ -33,11 +32,11 @@ |
switch hi.Kind { |
case hooks.RelationJoined, hooks.RelationChanged, hooks.RelationDeparted: |
if hi.RemoteUnit == "" { |
- return fmt.Errorf("%q hook requires a remote unit", hi.Kind) |
+ return errors.Newf("%q hook requires a remote unit", hi.Kind) |
} |
fallthrough |
case hooks.Install, hooks.Start, hooks.ConfigChanged, hooks.UpgradeCharm, hooks.Stop, hooks.RelationBroken: |
return nil |
} |
- return fmt.Errorf("unknown hook kind %q", hi.Kind) |
+ return errors.Newf("unknown hook kind %q", hi.Kind) |
} |