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

Issue 6296064: state: Second approach to improve the error handling. (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+109860
Visibility:
Public.

Description

state: Second approach to improve the error handling. This second approach returns error generated with fmt.Errorf() and containing high-level informations like names. In case of an internal error this is appended or, in case of some topology errors, directly returned. This depends on the returned error of the topology method. https://code.launchpad.net/~themue/juju-core/go-state-second-error-improvement/+merge/109860 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 4

Patch Set 2 : state: Second approach to improve the error handling. #

Total comments: 16

Patch Set 3 : state: Second approach to improve the error handling. #

Total comments: 11

Patch Set 4 : state: Second approach to improve the error handling. #

Total comments: 1

Patch Set 5 : state: Second approach to improve the error handling. #

Patch Set 6 : state: Second approach to improve the error handling. #

Patch Set 7 : state: Second approach to improve the error handling. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -49 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M state/state.go View 1 2 3 4 18 chunks +45 lines, -35 lines 0 comments Download
M state/state_test.go View 1 2 3 4 6 chunks +14 lines, -9 lines 0 comments Download
M state/util.go View 1 2 3 4 3 chunks +15 lines, -5 lines 0 comments Download

Messages

Total messages: 14
TheMue
Please take a look.
11 years, 10 months ago (2012-06-12 14:23:36 UTC) #1
niemeyer
https://codereview.appspot.com/6296064/diff/1/state/state.go File state/state.go (right): https://codereview.appspot.com/6296064/diff/1/state/state.go#newcode64 state/state.go:64: return fmt.Errorf("can't remove machine %d: %v", id, err) This ...
11 years, 10 months ago (2012-06-12 15:07:00 UTC) #2
rog
https://codereview.appspot.com/6296064/diff/1/state/state.go File state/state.go (right): https://codereview.appspot.com/6296064/diff/1/state/state.go#newcode32 state/state.go:32: return nil, fmt.Errorf("can't add a new machine: %v", err) ...
11 years, 10 months ago (2012-06-12 15:23:06 UTC) #3
niemeyer
https://codereview.appspot.com/6296064/diff/1/state/state.go File state/state.go (right): https://codereview.appspot.com/6296064/diff/1/state/state.go#newcode32 state/state.go:32: return nil, fmt.Errorf("can't add a new machine: %v", err) ...
11 years, 10 months ago (2012-06-12 19:52:46 UTC) #4
TheMue
Please take a look.
11 years, 10 months ago (2012-06-13 11:30:28 UTC) #5
rog
> > I'm not sure this style is right. > > > > When we ...
11 years, 10 months ago (2012-06-13 12:12:37 UTC) #6
niemeyer
Looks much better. Some changes done are unnecessary, though. Please see the ideas here and ...
11 years, 10 months ago (2012-06-13 12:32:37 UTC) #7
niemeyer
On 2012/06/13 12:12:37, rog wrote: > I'm not sure that we want to do that ...
11 years, 10 months ago (2012-06-13 12:39:04 UTC) #8
TheMue
Please take a look. https://codereview.appspot.com/6296064/diff/4001/state/state.go File state/state.go (left): https://codereview.appspot.com/6296064/diff/4001/state/state.go#oldcode171 state/state.go:171: return nil, err On 2012/06/13 ...
11 years, 10 months ago (2012-06-13 12:54:34 UTC) #9
rog
On 13 June 2012 13:39, <n13m3y3r@gmail.com> wrote: > It's clear to me that "look where ...
11 years, 10 months ago (2012-06-13 13:56:51 UTC) #10
niemeyer
https://codereview.appspot.com/6296064/diff/2003/state/state.go File state/state.go (right): https://codereview.appspot.com/6296064/diff/2003/state/state.go#newcode32 state/state.go:32: if path, err = s.zk.Create("/machines/machine-", "", zookeeper.SEQUENCE, zkPermAll); err ...
11 years, 10 months ago (2012-06-13 14:07:23 UTC) #11
TheMue
Please take a look. https://codereview.appspot.com/6296064/diff/2003/state/state.go File state/state.go (right): https://codereview.appspot.com/6296064/diff/2003/state/state.go#newcode32 state/state.go:32: if path, err = s.zk.Create("/machines/machine-", ...
11 years, 10 months ago (2012-06-13 14:58:05 UTC) #12
niemeyer
LGTM, with the minor fix: https://codereview.appspot.com/6296064/diff/5006/state/util.go File state/util.go (right): https://codereview.appspot.com/6296064/diff/5006/state/util.go#newcode294 state/util.go:294: func errorContext(err *error, format ...
11 years, 10 months ago (2012-06-13 15:03:44 UTC) #13
TheMue
11 years, 10 months ago (2012-06-13 15:52:16 UTC) #14
*** Submitted:

state: Second approach to improve the error handling.

This second approach returns error generated with fmt.Errorf()
and containing high-level informations like names. In case of
an internal error this is appended or, in case of some topology
errors, directly returned. This depends on the returned error
of the topology method.

R=niemeyer, rog
CC=
https://codereview.appspot.com/6296064
Sign in to reply to this message.

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