okhttp
okhttp copied to clipboard
RealEventSource lost control on Error
As shown in the code snippet, if an Error (such as OutOfMemoryError or StackOverflowError, which are common) is thrown at line 78, the catch block at line 81 will not catch this Error, and neither the onFailure nor onClose hooks will be called. Consequently, the processing flow will terminate silently. Therefore, it is recommended to catch Throwable instead.
I think we've generally avoided handling Throwables as failures app can deal with.
The state of OkHttpClient is generally unknown, so I'm inclined to leave this as unhandled.