Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(233)

Unified Diff: worker/uniter/hook/hook.go

Issue 62230043: state/..., worker/..., utils/...: use errgo
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « worker/uniter/filter_test.go ('k') | worker/uniter/hook/hook_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
}
« no previous file with comments | « worker/uniter/filter_test.go ('k') | worker/uniter/hook/hook_test.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b