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

Issue 6304084: state: Rework of the errors in machine.go. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 10 months ago by TheMue
Modified:
11 years, 10 months ago
Reviewers:
mp+110513
Visibility:
Public.

Description

state: Rework of the errors in machine.go. Next step in the reworking process of the state errors, this time the file machine.go. https://code.launchpad.net/~themue/juju-core/go-state-errors-machine/+merge/110513 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 9

Patch Set 2 : state: Rework of the errors in machine.go. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -9 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M state/machine.go View 1 3 chunks +9 lines, -7 lines 0 comments Download
M state/state_test.go View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4
TheMue
Please take a look.
11 years, 10 months ago (2012-06-15 12:46:36 UTC) #1
fwereade
LGTM, but fix inconsistency below please https://codereview.appspot.com/6304084/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode34 state/machine.go:34: return fmt.Errorf("waiting for ...
11 years, 10 months ago (2012-06-15 20:42:56 UTC) #2
niemeyer
LGTM with the following addressed. https://codereview.appspot.com/6304084/diff/1/state/machine.go File state/machine.go (right): https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode34 state/machine.go:34: return fmt.Errorf("waiting for agent ...
11 years, 10 months ago (2012-06-16 01:48:45 UTC) #3
TheMue
11 years, 10 months ago (2012-06-18 17:15:17 UTC) #4
*** Submitted:

state: Rework of the errors in machine.go.

Next step in the reworking process of the state errors,
this time the file machine.go.

R=fwereade, niemeyer
CC=
https://codereview.appspot.com/6304084

https://codereview.appspot.com/6304084/diff/1/state/machine.go
File state/machine.go (right):

https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode34
state/machine.go:34: return fmt.Errorf("waiting for agent of machine %s: %v", m,
err)
On 2012/06/16 01:48:45, niemeyer wrote:
> On 2012/06/15 20:42:56, fwereade wrote:
> > Inconsistent with "machine %d"s below.
> 
> Agreed. Let's have all of them as m and %s, please.

Done.

https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode54
state/machine.go:54: // missing key is fine
On 2012/06/16 01:48:45, niemeyer wrote:
> Can you please replace this comment by
> 
> // TODO Return NoInstanceIdError (also when it exists as "")
> 
> If one asks for the InstanceId, it's *not* fine to not give it back silently,
as
> this is extremely error prone. We need a public NoInstanceIdError error type
> that can be verified by callers (and that stringifies nicely), but that
prevents
> them from mistakingly assume they got an instance id if err == nil.

Done.

https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode60
state/machine.go:60: return "", fmt.Errorf("invalid internal machine key type:
%T", v)
On 2012/06/16 01:48:45, niemeyer wrote:
> ("invalid internal machine id type %T for machine %s", v, m)

Done.

https://codereview.appspot.com/6304084/diff/1/state/machine.go#newcode88
state/machine.go:88: defer errorContextf(&err, "can't set instance id of machine
%d", m.Id())
On 2012/06/16 01:48:45, niemeyer wrote:
> ("can't set instance id of machine %s to %q", m, id)

Done.
Sign in to reply to this message.

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