don't log ssl errors
Massimo Melina committed
Jun 17, 2026 at 18:50 UTC
5a0c3962f0a70adac7a488101afe5492f50c2085
1 file changed
+1
src/index.ts
+1
@@ -68,6 +68,7 @@ function errorHandler(err: Error & { code?: string, path?: string }) {
68
if (code === 'ECANCELED' || code === 'ECONNRESET' || code === 'ECONNABORTED' || code === 'EPIPE'
69
|| code === 'ERR_STREAM_WRITE_AFTER_END' // happens disconnecting uploads, don't care
70
|| code === 'ERR_STREAM_PREMATURE_CLOSE' // happens when many files are sent (not locally), but I checked that the files are written completely. Introduced after node18.5.0 and is thrown by pipeline() used by PUT method handler.
71
+ || code === 'ERR_SSL_SSL/TLS_ALERT_BAD_RECORD_MAC' // tls peers/proxies can abort encrypted streams after headers are already sent
72
|| code?.startsWith('HPE')) return // malformed client/probe HTTP parser errors, not internal failures
73
console.error('Server error', err)
74
}