http2: Change in respondWithFile api not properly reflected in the docs #15390
Closed
Description
The respondWithFile
api has changed between 8.4.0 and 8.5.0 with the addition of the onError option. This is important, because a simple response.stream.on('error'...
no longer works after this change because the steam gets destroyed on an error (in particular on ENOENT) if onError
doesn't exist so any attempt to resend a different file then crashes with stream undefined.
However the docs, although creating an onError
function in the example then doesn't actually use it on the call to respondWithFile