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

Issue 13474046: various: Use params.IsCode*(err) helpers (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by dimitern
Modified:
10 years, 7 months ago
Reviewers:
mp+185461, fwereade
Visibility:
Public.

Description

various: Use params.IsCode*(err) helpers I'm getting sick of writing every time: if params.ErrCode(err) == params.CodeSomething So I added a bunch of IsCode*(err) helpers to simplify this. https://code.launchpad.net/~dimitern/juju-core/136-params-error-code-helpers/+merge/185461 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2

Patch Set 2 : various: Use params.IsCode*(err) helpers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -96 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M agent/agent.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/agent.go View 2 chunks +3 lines, -3 lines 0 comments Download
M state/api/agent/machine_test.go View 1 4 chunks +4 lines, -4 lines 0 comments Download
M state/api/agent/unit_test.go View 1 3 chunks +3 lines, -2 lines 0 comments Download
M state/api/deployer/deployer_test.go View 1 2 chunks +2 lines, -1 line 0 comments Download
M state/api/machiner/machiner_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M state/api/params/apierror.go View 1 chunk +44 lines, -0 lines 0 comments Download
M state/api/uniter/relation_test.go View 1 3 chunks +3 lines, -2 lines 0 comments Download
M state/api/uniter/relationunit_test.go View 1 3 chunks +3 lines, -2 lines 0 comments Download
M state/api/uniter/unit_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download
M state/api/upgrader/upgrader_test.go View 1 3 chunks +4 lines, -4 lines 0 comments Download
M state/api/watcher/watcher.go View 1 chunk +1 line, -1 line 0 comments Download
M state/apiserver/client/perm_test.go View 1 9 chunks +12 lines, -9 lines 0 comments Download
M state/apiserver/common/errors_test.go View 1 3 chunks +72 lines, -49 lines 0 comments Download
M worker/deployer/deployer.go View 2 chunks +1 line, -2 lines 0 comments Download
M worker/machiner/machiner.go View 2 chunks +1 line, -2 lines 0 comments Download
M worker/uniter/context.go View 1 chunk +2 lines, -2 lines 0 comments Download
M worker/uniter/filter.go View 3 chunks +3 lines, -3 lines 0 comments Download
M worker/uniter/uniter.go View 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 3
dimitern
Please take a look.
10 years, 7 months ago (2013-09-13 10:40:43 UTC) #1
fwereade
LGTM https://codereview.appspot.com/13474046/diff/1/state/api/uniter/relation_test.go File state/api/uniter/relation_test.go (right): https://codereview.appspot.com/13474046/diff/1/state/api/uniter/relation_test.go#newcode71 state/api/uniter/relation_test.go:71: c.Assert(params.IsCodeUnauthorized(err), jc.IsTrue) FWIW these could be (err, jc.Satsifies, ...
10 years, 7 months ago (2013-09-13 10:45:22 UTC) #2
dimitern
10 years, 7 months ago (2013-09-13 11:37:03 UTC) #3
Please take a look.

https://codereview.appspot.com/13474046/diff/1/state/api/uniter/relation_test.go
File state/api/uniter/relation_test.go (right):

https://codereview.appspot.com/13474046/diff/1/state/api/uniter/relation_test...
state/api/uniter/relation_test.go:71: c.Assert(params.IsCodeUnauthorized(err),
jc.IsTrue)
On 2013/09/13 10:45:23, fwereade wrote:
> FWIW these could be (err, jc.Satsifies, params.IsCodeUnauthorized)
> 
> ...I think.

Good idea, done.
Sign in to reply to this message.

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