Provide a reason when aborting a request due to timeout #826
Labels
bug
Something isn't working
p2-nice-to-have
[Priority] Lower priority, beneficial enhancements that are not urgent.
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
blockThe text was updated successfully, but these errors were encountered: