Szpadel / chrome-headless-render-pdf

225 stars 67 forks source link

Improve error handling #51

Closed nigelzor closed 4 years ago

nigelzor commented 5 years ago

Two fixes:

cesarizu commented 5 years ago

This could use listen(0) to let node get a free port and then get the port with server.address().port. Then if there's any error, it is because it cannot really listen in any port.

nkl-kst commented 4 years ago

Hi, shouldn't this be merged? I think the current retry logic of selectFreePort is a serious bug: If the first random port ist not available, pdf generation will never be successful without any response because of an endless loop in waitForDebugPort.

Szpadel commented 4 years ago

Merged and published