|
|
|
Added json encoded for ServerErrors
added jsonEncode function to novaservice that
tries to convert the given error into a
ServerError and call its AsJSON method or
wrap the given error into a 500 ServerError
which will contain the original error message.
https://code.launchpad.net/~hduran-8/goose/json_encoded_errors/+merge/217860
Requires: https://code.launchpad.net/~hduran-8/goose/testservice_errors/+merge/217818
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Added json encoded for ServerErrors #
Total comments: 4
Patch Set 3 : Added json encoded for ServerErrors #
Total messages: 4
|
hduran
Please take a look.
|
11 years, 8 months ago (2014年05月01日 01:09:14 UTC) #1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Please take a look.
Please take a look.
LGTM. https://codereview.appspot.com/97870044/diff/20001/http/client.go File http/client.go (right): https://codereview.appspot.com/97870044/diff/20001/http/client.go#newcode62 http/client.go:62: return nil, err We seem to not be able to hit this error branch, that's fine. https://codereview.appspot.com/97870044/diff/20001/http/client.go#newcode64 http/client.go:64: response.Title = key Add break here. May as well exit early if we're passed something with many top level keys. https://codereview.appspot.com/97870044/diff/20001/http/client.go#newcode69 http/client.go:69: return nil, fmt.Errorf("Unexpected response format: %q", jsonBytes) "Unparsable json error body" https://codereview.appspot.com/97870044/diff/20001/http/client_test.go File http/client_test.go (right): https://codereview.appspot.com/97870044/diff/20001/http/client_test.go#newcod... http/client_test.go:191: c.Assert(unmarshalled.Message, Equals, "A Meaningful error") These attribute compares should be Check not Assert.