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

Issue 103500044: googleapi: parse errors and put more details into the error message

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by Ivan Krasin
Modified:
11 years, 4 months ago
Reviewers:
gmlewis1, bradfitz
CC:
gmlewis1, bradfitz, golang-codereviews
Visibility:
Public.

Description

This CL adds support of errors array returned by Google API frontend. In some cases, such as invalid API key, putting more details into the error message, may help API users to debug problems quickly. Side note: this is a response to a real issue we had a couple of days ago.

Patch Set 1 #

Patch Set 2 : added comment to ErrorItem #

Patch Set 3 : more comments #

Total comments: 5

Patch Set 4 : put return back; add a test case. #

Patch Set 5 : add expectations for error messages #

Total comments: 6

Patch Set 6 : Use %q #

Patch Set 7 : g.Error #

Total comments: 6

Patch Set 8 : fixed wording in the comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -3 lines) Patch
M googleapi/googleapi.go View 1 2 3 4 5 6 7 1 chunk +28 lines, -2 lines 0 comments Download
M googleapi/googleapi_test.go View 1 2 3 4 5 6 6 chunks +48 lines, -1 line 0 comments Download

Messages

Total messages: 13
Ivan Krasin
Hi Glenn, please, take a look at the CL.
11 years, 4 months ago (2014-06-18 23:12:10 UTC) #1
gmlewis1
Thanks, Ivan! https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go File googleapi/googleapi.go (right): https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go#newcode57 googleapi/googleapi.go:57: fmt.Sprintf("googleapi: got HTTP response code %d with ...
11 years, 4 months ago (2014-06-19 01:09:13 UTC) #2
Ivan Krasin
https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go File googleapi/googleapi.go (right): https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go#newcode57 googleapi/googleapi.go:57: fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", ...
11 years, 4 months ago (2014-06-19 01:16:04 UTC) #3
gmlewis1
LGTM Please allow bradfitz@ to review as well. https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go File googleapi/googleapi.go (right): https://codereview.appspot.com/103500044/diff/40001/googleapi/googleapi.go#newcode57 googleapi/googleapi.go:57: fmt.Sprintf("googleapi: ...
11 years, 4 months ago (2014-06-19 01:54:53 UTC) #4
Ivan Krasin
I have added expectations for error messages. Glenn, Brad, please take a look.
11 years, 4 months ago (2014-06-19 02:31:31 UTC) #5
gmlewis1
LGTM - just a couple nits https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go File googleapi/googleapi_test.go (right): https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go#newcode195 googleapi/googleapi_test.go:195: if g != ...
11 years, 4 months ago (2014-06-19 05:15:19 UTC) #6
Ivan Krasin
PTAL https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go File googleapi/googleapi_test.go (right): https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go#newcode195 googleapi/googleapi_test.go:195: if g != nil && fmt.Sprintf("%s", g) != ...
11 years, 4 months ago (2014-06-19 15:09:41 UTC) #7
gmlewis1
https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go File googleapi/googleapi_test.go (right): https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go#newcode195 googleapi/googleapi_test.go:195: if g != nil && fmt.Sprintf("%s", g) != test.errText ...
11 years, 4 months ago (2014-06-19 15:46:39 UTC) #8
Ivan Krasin
https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go File googleapi/googleapi_test.go (right): https://codereview.appspot.com/103500044/diff/80001/googleapi/googleapi_test.go#newcode195 googleapi/googleapi_test.go:195: if g != nil && fmt.Sprintf("%s", g) != test.errText ...
11 years, 4 months ago (2014-06-19 15:49:38 UTC) #9
Ivan Krasin
Friendly ping.
11 years, 4 months ago (2014-06-23 17:56:38 UTC) #10
bradfitz
LGTM Leaving for Glenn to submit. https://codereview.appspot.com/103500044/diff/120001/googleapi/googleapi.go File googleapi/googleapi.go (right): https://codereview.appspot.com/103500044/diff/120001/googleapi/googleapi.go#newcode47 googleapi/googleapi.go:47: // ErrorItem is ...
11 years, 4 months ago (2014-06-23 18:00:33 UTC) #11
Ivan Krasin
Done. https://codereview.appspot.com/103500044/diff/120001/googleapi/googleapi.go File googleapi/googleapi.go (right): https://codereview.appspot.com/103500044/diff/120001/googleapi/googleapi.go#newcode47 googleapi/googleapi.go:47: // ErrorItem is a detailed error found in ...
11 years, 4 months ago (2014-06-23 18:08:25 UTC) #12
gmlewis1
11 years, 4 months ago (2014-06-23 18:21:38 UTC) #13
*** Submitted as https://code.google.com/p/google-api-go-client/source/detail?r=0260180239b8 *** This CL adds support of errors array returned by Google API frontend. In some cases, such as invalid API key, putting more details into the error message, may help API users to debug problems quickly. Side note: this is a response to a real issue we had a couple of days ago. R=gmlewis, bradfitz CC=golang-codereviews https://codereview.appspot.com/103500044 Committer: Glenn Lewis <gmlewis@google.com>
Sign in to reply to this message.

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