Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datastore/request: add API error handling #153

Merged
merged 5 commits into from
Aug 30, 2014

Conversation

proppy
Copy link
Contributor

@proppy proppy commented Aug 29, 2014

When HTTP response are != from 200 we shouldn't try to decode a protobuf.

@@ -446,7 +446,15 @@ Transaction.prototype.makeReq = function(method, req, respType, callback) {
buffer = Buffer.concat([buffer, chunk]);
});
resp.on('end', function() {
callback(null, respType.decode(buffer));
if (resp.statusCode != 200) {

This comment was marked as spam.

@rakyll
Copy link
Contributor

rakyll commented Aug 29, 2014

npm run lint to lint your code.

@ryanseys
Copy link
Contributor

Silly question but is the response guaranteed to not be a decodable
protobuf if an error occurs? Or is the response always null/nothing if
error has a value?

On Friday, August 29, 2014, Johan Euphrosine notifications@github.com
wrote:

When HTTP response are != from 200 we shouldn't try to decode a protobuf.

You can merge this Pull Request by running

git pull https://github.com/proppy/gcloud-node add-error-handling

Or view, comment on, or merge it at:

#153
Commit Summary

  • datastore/request: add API error handling

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#153.

@proppy
Copy link
Contributor Author

proppy commented Aug 29, 2014

@ryanseys in case of an error the body should be JSON in the standard Google API format (with an error attribute).

@proppy
Copy link
Contributor Author

proppy commented Aug 29, 2014

PTAL

callback(err);
return;
}
return callback(null, respType.decode(buffer));

This comment was marked as spam.

This comment was marked as spam.

@proppy
Copy link
Contributor Author

proppy commented Aug 30, 2014

PTAL

@rakyll
Copy link
Contributor

rakyll commented Aug 30, 2014

Tests are failing.

@proppy
Copy link
Contributor Author

proppy commented Aug 30, 2014

Fixed, PTAL

rakyll pushed a commit that referenced this pull request Aug 30, 2014
datastore/request: add API error handling
@rakyll rakyll merged commit d539bf0 into googleapis:master Aug 30, 2014
callback(new Error('error during request, statusCode: ' + resp.statusCode));
var error = 'error during request, statusCode: ' + resp.statusCode;
if (body) {
error += ', body: ' + body;

This comment was marked as spam.

chingor13 pushed a commit that referenced this pull request Sep 12, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jsdoc-region-tag](https://github.com/googleapis/jsdoc-region-tag) | [`^1.0.6` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/jsdoc-region-tag</summary>

### [`v2.0.0`](https://github.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#&#8203;200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20)

[Compare Source](https://github.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0)

##### ⚠ BREAKING CHANGES

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107))

##### Build System

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://github.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923))

##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11)

##### Bug Fixes

-   **build:** migrate to using main branch ([#&#8203;79](https://www.github.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **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 [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-artifact-registry).
chingor13 pushed a commit that referenced this pull request Sep 14, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [jsdoc-region-tag](https://github.com/googleapis/jsdoc-region-tag) | [`^1.0.6` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/jsdoc-region-tag</summary>

### [`v2.0.0`](https://github.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#&#8203;200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20)

[Compare Source](https://github.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0)

##### ⚠ BREAKING CHANGES

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107))

##### Build System

-   update library to use Node 12 ([#&#8203;107](https://github.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://github.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923))

##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11)

##### Bug Fixes

-   **build:** migrate to using main branch ([#&#8203;79](https://www.github.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **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 [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-artifact-registry).
sofisl pushed a commit that referenced this pull request Oct 13, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [mocha](https://mochajs.org/) ([source](https://github.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) |

---

### Release Notes

<details>
<summary>mochajs/mocha</summary>

### [`v8.0.1`](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;801--2020-06-10)

[Compare Source](https://github.com/mochajs/mocha/compare/v8.0.0...v8.0.1)

The obligatory patch after a major.

#### 🐛 Fixes

-   [#&#8203;4328](https://github.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@&#8203;boneskull**](https://github.com/boneskull))

### [`v8.0.0`](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#&#8203;800--2020-06-10)

[Compare Source](https://github.com/mochajs/mocha/compare/v7.2.0...v8.0.0)

In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below.

Let's welcome [**@&#8203;giltayar**](https://github.com/giltayar) and [**@&#8203;nicojs**](https://github.com/nicojs) to the maintenance team!

#### 💥 Breaking Changes

-   [#&#8203;4164](https://github.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@&#8203;UlisesGascon**](https://github.com/UlisesGascon))

-   [#&#8203;4175](https://github.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@&#8203;juergba**](https://github.com/juergba))

    ✨ **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs).

-   [#&#8203;4260](https://github.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@&#8203;craigtaub**](https://github.com/craigtaub))

    ✨ **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`.

-   [#&#8203;4315](https://github.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@&#8203;juergba**](https://github.com/juergba))

    ✨ **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`).

-   [#&#8203;4309](https://github.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@&#8203;juergba**](https://github.com/juergba))

-   [#&#8203;4282](https://github.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@&#8203;arvidOtt**](https://github.com/arvidOtt))

-   [#&#8203;4223](https://github.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@&#8203;juergba**](https://github.com/juergba))

-   [#&#8203;4178](https://github.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@&#8203;wnghdcjfe**](https://github.com/wnghdcjfe)):
    -   `Mocha.prototype.ignoreLeaks()`
    -   `Mocha.prototype.useColors()`
    -   `Mocha.prototype.useInlineDiffs()`
    -   `Mocha.prototype.hideDiff()`

#### 🎉 Enhancements

-   [#&#8203;4245](https://github.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@&#8203;boneskull**](https://github.com/boneskull))

    ❗ See also [#&#8203;4244](https://github.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_

-   [#&#8203;4304](https://github.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@&#8203;JacobLey**](https://github.com/JacobLey))

-   [#&#8203;4299](https://github.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@&#8203;giltayar**](https://github.com/giltayar))

#### 📖 Documentation

-   [#&#8203;4246](https://github.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@&#8203;boneskull**](https://github.com/boneskull))

#### 🐛 Fixes

(All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)

</details>

---

### Renovate 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, check this box

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-phishing-protection).
sofisl added a commit that referenced this pull request Nov 11, 2022
* chore: migrate to owl bot

* chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b

* chore: run the post processor

* 🦉 Updates from OwlBot

* fix: help tests pass

* 🦉 Updates from OwlBot

* update Docker image

* 🦉 Updates from OwlBot

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Sofia Leon <sofialeon@google.com>
sofisl added a commit that referenced this pull request Nov 11, 2022
* build!: Update library to use Node 12

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Nov 11, 2022
🤖 I have created a release *beep* *boop*
---


## [2.0.0](googleapis/nodejs-binary-authorization@v1.5.1...v2.0.0) (2022-06-30)


### ⚠ BREAKING CHANGES

* make v1 default service version (#139)
* update library to use Node 12 (#153)

### Features

* Adds a pod_namespace field to pod events created by Continuous Validation, to distinguish pods with the same name that run in different namespaces ([#159](googleapis/nodejs-binary-authorization#159)) ([db983a2](googleapis/nodejs-binary-authorization@db983a2))
* Import of Grafeas from Github ([#156](googleapis/nodejs-binary-authorization#156)) ([d0f06b7](googleapis/nodejs-binary-authorization@d0f06b7))
* make v1 default service version ([#139](googleapis/nodejs-binary-authorization#139)) ([308286e](googleapis/nodejs-binary-authorization@308286e))


### Bug Fixes

* **docs:** describe fallback rest option ([#160](googleapis/nodejs-binary-authorization#160)) ([dc48528](googleapis/nodejs-binary-authorization@dc48528))


### Build System

* update library to use Node 12 ([#153](googleapis/nodejs-binary-authorization#153)) ([cafc43b](googleapis/nodejs-binary-authorization@cafc43b))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this pull request Nov 11, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [ts-loader](https://github.com/TypeStrong/ts-loader) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>TypeStrong/ts-loader</summary>

### [`v9.0.0`](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900)

[Compare Source](https://github.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0)

Breaking changes:

-   minimum webpack version: 5
-   minimum node version: 12

Changes:

-   [webpack 5 migration](https://github.com/TypeStrong/ts-loader/pull/1251) - thanks [@&#8203;johnnyreilly](https://github.com/johnnyreilly), [@&#8203;jonwallsten](https://github.com/jonwallsten), [@&#8203;sokra](https://github.com/sokra), [@&#8203;appzuka](https://github.com/appzuka), [@&#8203;alexander-akait](https://github.com/alexander-akait)

</details>

---

### Configuration

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

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

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

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

---

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

---

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-bigquery-storage).
sofisl pushed a commit that referenced this pull request Nov 11, 2022
* chore(main): release 2.1.1

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Nov 16, 2022
* chore(main): release 2.1.3

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Nov 16, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 474338479

Source-Link: googleapis/googleapis@d5d35e0

Source-Link: googleapis/googleapis-gen@efcd3f9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9
sofisl pushed a commit that referenced this pull request Nov 16, 2022
- [ ] Regenerate this pull request now.

Committer: @summer-ji-eng
PiperOrigin-RevId: 424244721

Source-Link: googleapis/googleapis@4b6b01f

Source-Link: googleapis/googleapis-gen@8ac83fb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9
sofisl pushed a commit that referenced this pull request Nov 17, 2022
sofisl pushed a commit that referenced this pull request Nov 30, 2022
sofisl pushed a commit that referenced this pull request Jan 10, 2023
sofisl pushed a commit that referenced this pull request Jan 26, 2023
sofisl pushed a commit that referenced this pull request Sep 13, 2023
Release @google-cloud/automl v0.2.0

This pull request was generated using releasetool.

#153 automerged by dpebot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants