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

Cannot import RETRYABLE_ERR_FN_DEFAULT #2516

Closed
Cynocracy opened this issue Sep 3, 2024 · 2 comments · Fixed by #2517
Closed

Cannot import RETRYABLE_ERR_FN_DEFAULT #2516

Cynocracy opened this issue Sep 3, 2024 · 2 comments · Fixed by #2517
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

@Cynocracy
Copy link
Contributor

Cynocracy commented Sep 3, 2024

Is your feature request related to a problem? Please describe.
I want to import RETRYABLE_ERR_FN_DEFAULT to be able to customize it
Describe the solution you'd like
export RETRYABLE_ERR_FN_DEFAULT
Describe alternatives you've considered
Copying the code into my repo is my current option, but this will drift from upstream over time, and hurts Google's ability to provide good service through GCS to nodejs consumers, imo.
Additional context

@Cynocracy Cynocracy 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 Sep 3, 2024
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Sep 3, 2024
@ddelgrosso1
Copy link
Contributor

Hi @Cynocracy

The function is already customizable by passing a function here:

https://github.com/googleapis/nodejs-storage/blob/main/src/storage.ts#L76-#L84

Which can be passed to the Storage constructor here:

retryOptions?: RetryOptions;

Is there another reason you want to have the default exported?

@Cynocracy
Copy link
Contributor Author

Cynocracy commented Sep 4, 2024

@ddelgrosso1 I want to customize the default with

retryableErrorFn: (error) => {
    const original = RETRYABLE_ERR_FN_DEFAULT(error);
    // log the error
    return original;      
}

if the default is not exported, I would have to reimplement it

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