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

Missing error interface exports #2261

Closed
Padavan opened this issue Aug 8, 2023 · 1 comment · Fixed by #2291
Closed

Missing error interface exports #2261

Padavan opened this issue Aug 8, 2023 · 1 comment · Fixed by #2291
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@Padavan
Copy link

Padavan commented Aug 8, 2023

Environment details

  • OS: Win x64 22H2
  • Node.js version: 18.14.0
  • npm version: 9.3.1
  • @google-cloud/storage version: 6.9.5 / 7.0.1

Steps to reproduce

  1. Try to handle errors for bucket.upload with strict typescript or with enabled useUnknownInCatchVariables rule.

  2. Can not safely access e.code or e.errors without ApiError interface

It appears sdk is not exporting Error interfaces these in the index file: https://github.com/googleapis/nodejs-storage/blob/main/src/nodejs-common/util.ts#L248

Workaround

In version 7.0.1 it's possible to import directly from "@google-cloud/storage/build/src/nodejs-common"

@Padavan Padavan added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Aug 8, 2023
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Aug 8, 2023
@danielbankhead danielbankhead self-assigned this Aug 9, 2023
@danielbankhead
Copy link
Contributor

Hey @Padavan, I've opened #2291 to resolve this for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants