colly icon indicating copy to clipboard operation
colly copied to clipboard

The code panics in a certain OnResponse. How can the code not stop?

Open lovemianhuatang opened this issue 3 years ago • 7 comments

The code accidentally panics in a certain OnResponse, how can the code not stop? Let other requests continue.

lovemianhuatang avatar Feb 23 '22 06:02 lovemianhuatang

image 请问,这个Goroutine里能否选择添加defer recover机制? @WGH-

lovemianhuatang avatar Feb 23 '22 09:02 lovemianhuatang

I don't understand Chinese, could you repeat your question in English?

WGH- avatar Feb 23 '22 09:02 WGH-

The code accidentally panics in a certain OnResponse, how can the code not stop? Let other requests continue. Now the program exits directly.

Excuse me, can I choose to add a defer recover mechanism to the fetch goroutine?

lovemianhuatang avatar Feb 23 '22 10:02 lovemianhuatang

@WGH-

lovemianhuatang avatar Feb 23 '22 10:02 lovemianhuatang

image This will not cause the program to exit directly.

lovemianhuatang avatar Feb 23 '22 10:02 lovemianhuatang

Do you have time to look at this question? How to implement this function without changing the source code. @WGH-

lovemianhuatang avatar Feb 24 '22 09:02 lovemianhuatang

Experienced it once too. Seems like the whole package does not use recover anywhere.

mar1n3r0 avatar Aug 09 '22 13:08 mar1n3r0