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

Provide a reason when aborting a request due to timeout #826

Open
dovca opened this issue Jun 17, 2024 · 3 comments
Open

Provide a reason when aborting a request due to timeout #826

dovca opened this issue Jun 17, 2024 · 3 comments
Labels
bug Something isn't working p2-nice-to-have [Priority] Lower priority, beneficial enhancements that are not urgent.

Comments

@dovca
Copy link

dovca commented Jun 17, 2024


Expected Behavior

When the storyblok client aborts a request on timeout, a reason should be provided to allow for better logging and debugging. The current default of "AbortError: The operation was aborted." does not provide enough useful context.

Minimal viable solution:

Abort with a reason object providing the request params (url, method, ...), preferably as an instance of some TimeoutError class which can be easily identified in user code.

Ideal solution:

Allow users to define an optional factory function for timeout abort reasons.

Current Behavior

The client aborts a request without an explicit reason.

Steps to Reproduce

  1. Create a new client instance with a specified timeout
  2. Execute a request wrapped in try/catch
  3. When the request is aborted, a generic error is passed into catch block
@jonathanribas
Copy link

We have same issue on our side, already opened ticket to Storyblok support and they don't see those timeouts...

@alvarosabu alvarosabu added the pending-triage [Issue] Ticket is pending to be prioritised label Aug 21, 2024
@alvarosabu alvarosabu added bug Something isn't working p2-nice-to-have [Priority] Lower priority, beneficial enhancements that are not urgent. and removed pending-triage [Issue] Ticket is pending to be prioritised labels Oct 17, 2024
@alvarosabu
Copy link
Contributor

Hi @jonathanribas @dovca in case that support wasn't able to reproduce, would you be so kind as to provide a minimal reproduction using Stackblitz for example

Thanks

@jonathanribas
Copy link

Hi @alvarosabu, it is very random so we don't have a step to reproduce, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2-nice-to-have [Priority] Lower priority, beneficial enhancements that are not urgent.
Projects
None yet
Development

No branches or pull requests

3 participants