Skip to content

Interceptor callback exceptions can turn successful fetches into rejections #6

Description

@mktbsh

Summary

The fetch interceptor currently calls matcher and onIntercept directly in the request path. If either callback throws, the original fetch() call rejects even when the network request itself succeeded.

That makes interception logic capable of breaking application behavior.

Current behavior

A successful response can be converted into a rejected fetch() promise when user-supplied interception code throws.

Expected behavior

Interception should be observational by default. Callback failures should not change the success or failure of the original fetch() unless the library explicitly documents that behavior.

Impact

  • Logging or analytics code can break production requests
  • Consumers have to wrap every callback defensively to avoid changing network semantics
  • The library is not transparently safe to enable around existing code

Suggested acceptance criteria

  • Exceptions thrown by matcher or onIntercept do not reject a successful fetch() call
  • Failure handling behavior is documented
  • Tests cover callback exceptions for both matcher and interception callbacks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions