Client network socket disconnected before secure TLS connection was established
Bug Description
I get an error when using a proxy. I cannot catch the error so it crashes my app.
My code:
try{
const req = await request('https://discord.com/api/v9/invites/discord', {
query: {
inputValue: 'discord',
with_counts: true,
with_expiration: true
},
dispatcher: agent
})
const data = await req.body.json()
return data
}catch{
console.log('An error occurred.')
return false
}
Reproducible By
I sent lots of requests with my proxy and on the odd chance it will throw this error
Expected Behavior
Error should be caught.
Logs & Screenshots
Environment
OS: Windows 11 Node Version: 18.13.0
Additional context
I can restart my app and the whole process will happen again. I just want to catch the error lol so I can handle it.
Can you provide an Minimum Reproducible Example that isolates the issue you are describing?
What is the error? msg? stack?
Can you provide an Minimum Reproducible Example that isolates the issue you are describing?
try{
const req = await request('https://discord.com/api/v9/invites/discord', {
query: {
inputValue: 'discord',
with_counts: true,
with_expiration: true
},
dispatcher: agent
})
const data = await req.body.json()
return data
}catch{
console.log('An error occurred.')
return false
}
Sorry but that's not enough to reproduce your use case, you mentioned proxy so maybe there might be the root cause as the request works accordingly.
Any stack, error, message?