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
Create a new client instance with a specified timeout
Execute a request wrapped in try/catch
When the request is aborted, a generic error is passed into catch block
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
try/catch
catch
block