GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — common: handle unknown api errors. by stephenplusplus · Pull Request #203 · googleapis/google-cloud-node

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

When I was playing around with my awesome sillycloud app (source, demo), I ran into an issue where I had to parse an error string to get a useful status code: https://github.com/stephenplusplus/sillycloud/blob/master/actions.js#L36

The error I was getting was because I was using the wrong JSON key file, so what was actually failing wasn't the json datastore api, but the googleapis.com datastore request from Transaction#makeReq. I'm probably telling you what you already know, but the error response format from that host doesn't match the nice format we get from a cloud service json API request.

While we can't provide a very detailed error from that failed request, the end user should at least have a consistent format to expect from us, so I made these, and any other non-200s error cases an ApiError instance.

👍 or 👎 ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@stephenplusplus
common: handle unknown api errors.
a4811e3
@rakyll

rakyll commented Sep 10, 2014

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rakyll pushed a commit that referenced this pull request Sep 10, 2014
Burcu Dogan
Merge pull request #203 from stephenplusplus/error-responses
77e42f5
common: handle unknown api errors.
@rakyll
rakyll merged commit 77e42f5 into googleapis:master Sep 10, 2014
@sofisl sofisl mentioned this pull request Sep 15, 2022
migrate code from googleapis/nodejs-redis #3360
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Sep 15, 2022
@yoshi-automation @JustinBeckwith
chore: release 1.2.0 (#203)
fee5dc8
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
sofisl pushed a commit that referenced this pull request Sep 27, 2022
@yoshi-automation @JustinBeckwith
docs: update comments on protos (#203)
4a67558
@sofisl sofisl mentioned this pull request Sep 27, 2022
migrate code from googleapis/nodejs-video-intelligence #3374
Closed
4 tasks
@sofisl sofisl mentioned this pull request Oct 11, 2022
migrate code from googleapis/nodejs-language #3395
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Oct 11, 2022
@renovate @callmehiphop
fix(deps): update dependency yargs to v13 (#203)
c30f095
@sofisl sofisl mentioned this pull request Oct 12, 2022
migrate code from googleapis/nodejs-bigquery-data-transfer #3399
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Oct 12, 2022
@yoshi-automation @JustinBeckwith
fix: DEADLINE_EXCEEDED retry code is idempotent (#203)
667c20a
sofisl pushed a commit that referenced this pull request Oct 12, 2022
Benjamin E. Coe @JustinBeckwith
update to .nycrc with --all enabled (#203)
6ab407e
This was referenced Oct 12, 2022
migrate code from googleapis/nodejs-resource-manager #3402
Merged
migrate code from googleapis/nodejs-phishing-protection #3406
Merged
sofisl pushed a commit that referenced this pull request Oct 13, 2022
@release-please
chore: release 2.3.0 (#203)
37f2a56
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Oct 13, 2022
@renovate-bot
chore(deps): update dependency sinon to v12 (#203)
cf6fda7
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sinonjs/sinon</summary>

### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#&#8203;1201)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1)

-   [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3)
    Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng)
    > 'npm unlink' would implicitly unlink the current dir
    > until version 7, which requires an argument
-   [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b)
    Fix bundling of cjs module ([#&#8203;2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat)
    > -   Fix bundling of cjs module
    >
    > -   Run prettier

*Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.*

#### 12.0.0

### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)

</details>

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-recommender).
@sofisl sofisl mentioned this pull request Oct 13, 2022
migrate code from googleapis/nodejs-recommender #3409
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Oct 13, 2022
@renovate @sofisl
fix(deps): update dependency yargs to v13 (#203)
9cd9306
sofisl pushed a commit that referenced this pull request Oct 13, 2022
@yoshi-automation @sofisl
fix: DEADLINE_EXCEEDED retry code is idempotent (#203)
6623ee7
sofisl pushed a commit that referenced this pull request Nov 9, 2022
@yoshi-automation @JustinBeckwith
docs: update comments on protos (#203)
a2d8751
This was referenced Nov 9, 2022
migrate code from googleapis/nodejs-video-intelligence #3507
Closed
migrate code from googleapis/nodejs-video-intelligence #3519
Merged
sofisl pushed a commit that referenced this pull request Nov 11, 2022
@renovate @JustinBeckwith
fix(deps): update dependency google-gax to v1 (#203)
980dea6
This was referenced Nov 11, 2022
migrate code from googleapis/nodejs-dataproc #3533
Merged
migrate code from googleapis/nodejs-cloud-container #3543
Merged
sofisl pushed a commit that referenced this pull request Nov 11, 2022
@yoshi-automation @JustinBeckwith
feat: support apiEndpoint override in client constructor (#203)
c61d877
@sofisl sofisl mentioned this pull request Nov 11, 2022
migrate code from googleapis/nodejs-monitoring #3545
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Nov 11, 2022
@renovate @JustinBeckwith
chore(deps): update dependency eslint-config-prettier to v4 (#203)
a5e7022
@sofisl sofisl mentioned this pull request Nov 11, 2022
migrate code from googleapis/nodejs-scheduler #3547
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 23, 2026
@JustinBeckwith @alexander-fenster
Retry npm install in CI (#203)
3e69134
@GautamSharda GautamSharda mentioned this pull request Feb 23, 2026
migrate code from googleapis/nodejs-error-reporting #7294
Closed
GautamSharda pushed a commit that referenced this pull request Feb 26, 2026
@JustinBeckwith @alexander-fenster
Retry npm install in CI (#203)
f42dc44
@GautamSharda GautamSharda mentioned this pull request Feb 26, 2026
migrate code from googleapis/nodejs-error-reporting #7308
Merged
4 tasks
codyoss pushed a commit that referenced this pull request Mar 5, 2026
@fhinkel
chore: delete Node 8 presubmit tests (#203)
e40574e
@codyoss codyoss mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-projectify #7511
Merged
GautamSharda pushed a commit that referenced this pull request Mar 5, 2026
@JustinBeckwith
chore: upgrade to the latest common-grpc (#203)
220ce64
@GautamSharda GautamSharda mentioned this pull request Mar 5, 2026
migrate code from googleapis/nodejs-logging #7514
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Mar 5, 2026
Benjamin E. Coe @JustinBeckwith
fix(docs): move to new client docs URL (#203)
46fd6e5
sofisl pushed a commit that referenced this pull request Mar 5, 2026
@yoshi-automation
build(node_library): migrate to Trampoline V2 (#203)
b0c8ebd
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/ce28a18d-da8c-4e38-94c0-e9f48b3c281e/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@0c868d4
codyoss pushed a commit that referenced this pull request Mar 9, 2026
@yoshi-automation
build: update templates for Node.js libraries (#203)
b320395
@codyoss codyoss mentioned this pull request Mar 9, 2026
migrate code from googleapis/nodejs-paginator #7536
Closed
@meltsufin meltsufin mentioned this pull request Mar 10, 2026
chore: migrate code from googleapis/nodejs-logging #7550
Merged
codyoss pushed a commit that referenced this pull request Mar 11, 2026
@yoshi-automation @codyoss
build: update templates for Node.js libraries (#203)
2baa491
@codyoss codyoss mentioned this pull request Mar 11, 2026
migrate code from googleapis/nodejs-paginator #7590
Merged
GautamSharda pushed a commit that referenced this pull request Mar 11, 2026
@renovate @JustinBeckwith
chore(deps): lock file maintenance (#203)
f79d967
This was referenced Mar 11, 2026
migrate code from googleapis/nodejs-pubsub #7592
Merged
migrate code from googleapis/nodejs-promisify #7595
Closed
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@yoshi-automation
chore(nodejs_templates): add script logging to node_library populate-…
e443aba
…secrets.sh (#203)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/e306327b-605f-4c07-9420-c106e40c47d5/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@e703494
@GautamSharda GautamSharda mentioned this pull request Mar 12, 2026
migrate code from googleapis/nodejs-promisify #7596
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@yoshi-automation
chore(nodejs_templates): add script logging to node_library populate-…
0fa2ab1
…secrets.sh (#203)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/e306327b-605f-4c07-9420-c106e40c47d5/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@e703494
GautamSharda pushed a commit that referenced this pull request Mar 12, 2026
@JustinBeckwith
chore: Release v0.21.0 (#203)
c1f4bc5
@GautamSharda GautamSharda mentioned this pull request Mar 12, 2026
migrate code from googleapis/nodejs-common #7597
Merged
4 tasks
sofisl added a commit that referenced this pull request Mar 17, 2026
@sofisl
feat: allow synthetic default imports when testing typescript for esm (…
e37544b
…#203)
GautamSharda pushed a commit that referenced this pull request Mar 23, 2026
@kolodny @sduskis
Fix rowKey being force stringified to utf8 (#203)
ba59cbc
* Don't autoconvert a rowKey to utf8 string; Allow custom decoding

* Use more appropriate default for empty rowKey

* Added docs and more tests
@GautamSharda GautamSharda mentioned this pull request Mar 23, 2026
migrate code from googleapis/nodejs-bigtable #7852
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Mar 25, 2026
@kolodny @GautamSharda
Fix rowKey being force stringified to utf8 (#203)
cc77a19
* Don't autoconvert a rowKey to utf8 string; Allow custom decoding

* Use more appropriate default for empty rowKey

* Added docs and more tests
feywind pushed a commit that referenced this pull request Mar 27, 2026
@renovate @JustinBeckwith
chore(deps): lock file maintenance (#203)
c6af2f9
shivanee-p pushed a commit that referenced this pull request Mar 27, 2026
@kolodny @shivanee-p
Fix rowKey being force stringified to utf8 (#203)
a10ab26
* Don't autoconvert a rowKey to utf8 string; Allow custom decoding

* Use more appropriate default for empty rowKey

* Added docs and more tests
thiyaguk09 pushed a commit to thiyaguk09/google-cloud-node-fork that referenced this pull request May 5, 2026
@kolodny @thiyaguk09
Fix rowKey being force stringified to utf8 (googleapis#203)
4a1b539
* Don't autoconvert a rowKey to utf8 string; Allow custom decoding

* Use more appropriate default for empty rowKey

* Added docs and more tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@stephenplusplus @rakyll
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.