GoogleCloudPlatform / GoogleCloudPlatform/datashare-toolkit

API error when Datashare schema is not provisioned

Open
#142 0 comments 0 reactions 0 assignees View on GitHub
api bug
Dominant language
JavaScript
Stars
94
Forks
27
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
API error when **Datashare** schema is not provisioned. Calling the the /accounts resource, the API times out with a 503 error that is not propagated to the client. These are the server logs:
```
2020-05-29 15:26:23.526 EDT(node:1) UnhandledPromiseRejectionWarning: Error: Not found: Dataset agp-dj-001:datashare was not found in location US
2020-05-29 15:26:23.526 EDT at new ApiError (/shared/node_modules/@google-cloud/common/build/src/util.js:58:15)
2020-05-29 15:26:23.526 EDT at /shared/node_modules/@google-cloud/bigquery/build/src/bigquery.js:1066:23
2020-05-29 15:26:23.526 EDT at /shared/node_modules/@google-cloud/common/build/src/util.js:367:25
2020-05-29 15:26:23.526 EDT at Util.handleResp (/shared/node_modules/@google-cloud/common/build/src/util.js:144:9)
2020-05-29 15:26:23.526 EDT at /shared/node_modules/@google-cloud/common/build/src/util.js:432:22
2020-05-29 15:26:23.526 EDT at onResponse (/shared/node_modules/retry-request/index.js:206:7)
2020-05-29 15:26:23.526 EDT at /shared/node_modules/teeny-request/build/src/index.js:233:13
2020-05-29 15:26:23.526 EDT at processTicksAndRejections (internal/process/task_queues.js:85:5)
2020-05-29 15:26:23.526 EDT(node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
```

**Version**
[v0.3.0](https://github.com/GoogleCloudPlatform/datashare-toolkit/tree/v0.3.0)

**To Reproduce**
Steps to reproduce the behavior:
1. Deploy API
2. Call /accounts endpoint without provisioning Datashare schema
3. See error

**Expected behavior**
Propagate descriptive error that schema DNE up to client and handle gracefully.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.