question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Network interceptor connection() might be null

See original GitHub issue

For example, if looking up the connection after a request is completed, and it has both Connection: close and an empty response body.

See https://github.com/facebook/stetho/issues/346

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dave-r12commented, Apr 17, 2016

I responded on the stetho issue, I believe that person is referring to the ApplicationInterceptorChain class. Returning null for connection() is deliberate. The wiki mentions connection() is available with network interceptors only. Let me know if I’m misunderstanding something.

0reactions
swankjessecommented, Apr 17, 2016

Ah cool. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

OkHttp interceptor keep returning null and crashing the app
I have an OkHttp client which uses my custom network interceptor in order to insert token into requests header. I ...
Read more >
Android: Intercept on no internet connection | by Elye - Medium
So in this blog, I'll show how to setup no internet connection detection naturally in OkHttp, which only needs to be done once...
Read more >
okhttp3.Interceptor$Chain.connection java code examples
Returns the connection the request will be executed on. This is only available in the chains of network interceptors; for application interceptors this...
Read more >
Seamless Network State Monitoring With Retrofit + OkHttp
To monitor the state of the network we'll use an OkHttp Interceptor. An Interceptor will let us “intercept” the web request and perform...
Read more >
Interceptors - OkHttp
Register an application interceptor by calling addInterceptor() on OkHttpClient. ... The network interceptor's Chain has a non-null Connection that can be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found