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

[Bug]: Use of unimplemented 'init(request:cachedResponse:client:)' in RealHTTP.HTTPStubURLProtocol #61

Closed
malcommac opened this issue Sep 22, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@malcommac
Copy link
Collaborator

Platform Version

Any

SDK Version

Any

Xcode Version

Any

Steps To Reproduce

It's not always reproducible, but typically, it happens at the startup.

The error is:

RealHTTP/HTTPStubURLProtocol.swift:18: Fatal error: Use of unimplemented initializer 'init(request:cachedResponse:client:)' for class 'RealHTTP.HTTPStubURLProtocol'
(lldb) 

Expected Behavior

Init continue w/o crash

Actual Incorrect Behavior

Crash of the hosted app.

@malcommac malcommac added the bug Something isn't working label Sep 22, 2022
@malcommac malcommac added this to the 1.7.2 milestone Sep 22, 2022
@malcommac malcommac self-assigned this Sep 22, 2022
@malcommac
Copy link
Collaborator Author

Solution to this bug is to implement the callback and call super:

  // Occasionally called by iOS, even though init(task:...) is implemented. Will cause a crash if not present.
  override init(request: URLRequest, cachedResponse: CachedURLResponse?, client: URLProtocolClient?) {
     super.init(request: request, cachedResponse: cachedResponse, client: client)
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant